paintedlayer-recycling-6.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>Adding a new 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. #aboutToBecomeVisible {
  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="aboutToBecomeVisible" style="visibility: hidden">
  41. <!--
  42. This item starts out hidden, and will get its own PaintedLayer when it
  43. becomes visible.
  44. -->
  45. </div>
  46. <div class="fixed content">
  47. <!--
  48. This layer is just there to force the next .onTopOfFixed into its own
  49. PaintedLayer.
  50. -->
  51. </div>
  52. <div class="onTopOfFixed reftest-no-paint content">
  53. <!--
  54. This item shouldn't repaint when the other .onTopOfFixed item becomes visible.
  55. -->
  56. </div>
  57. <script>
  58. function doTest() {
  59. document.querySelector("#aboutToBecomeVisible").style.visibility = "visible";
  60. document.documentElement.removeAttribute("class");
  61. }
  62. document.addEventListener("MozReftestInvalidate", doTest, false);
  63. </script>