paintedlayer-recycling-5.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>Removing an existing display item that has its own PaintedLayer shouldn't cause invalidations in other PaintedLayers on top of it</title>
  5. <style>
  6. .content {
  7. box-sizing: border-box;
  8. width: 200px;
  9. height: 200px;
  10. border: 1px solid black;
  11. }
  12. .fixed {
  13. position: fixed;
  14. top: 20px;
  15. left: 140px;
  16. }
  17. .onTopOfFixed {
  18. position: absolute;
  19. top: 120px;
  20. left: 260px;
  21. }
  22. .reftest-no-paint {
  23. border-color: lime;
  24. }
  25. #aboutToBecomeHidden {
  26. left: 20px;
  27. }
  28. body {
  29. margin: 0;
  30. padding: 20px;
  31. height: 3000px;
  32. }
  33. </style>
  34. <div class="fixed content">
  35. <!--
  36. This layer is just there to force .onTopOfFixed into PaintedLayers above
  37. the page background.
  38. -->
  39. </div>
  40. <div class="onTopOfFixed content" id="aboutToBecomeHidden" style="visibility: visible">
  41. <!--
  42. This item starts out visible, and has its own PaintedLayer.
  43. -->
  44. </div>
  45. <div class="fixed content">
  46. <!--
  47. This layer is just there to force the next .onTopOfFixed into its own
  48. PaintedLayer.
  49. -->
  50. </div>
  51. <div class="onTopOfFixed reftest-no-paint content">
  52. <!--
  53. This item shouldn't repaint when the other .onTopOfFixed item is hidden.
  54. -->
  55. </div>
  56. <script>
  57. function doTest() {
  58. document.querySelector("#aboutToBecomeHidden").style.visibility = "hidden";
  59. document.documentElement.removeAttribute("class");
  60. }
  61. document.addEventListener("MozReftestInvalidate", doTest, false);
  62. </script>