paintedlayer-recycling-3.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>Adding a new display item to the bottom of an existing PaintedLayer shouldn't cause the other items in that layer to change layers</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 a PaintedLayer above
  37. the page background.
  38. -->
  39. </div>
  40. <div class="onTopOfFixed content" id="aboutToBecomeVisible" style="visibility: hidden">
  41. <!--
  42. This item starts out invisible but should end up in the same layer as the other
  43. .onTopOfFixed item, once it's visible.
  44. -->
  45. </div>
  46. <div class="onTopOfFixed reftest-no-paint content">
  47. <!--
  48. This item shouldn't repaint when the other .onTopOfFixed item becomes visible.
  49. -->
  50. </div>
  51. <script>
  52. function doTest() {
  53. document.querySelector("#aboutToBecomeVisible").style.visibility = "visible";
  54. document.documentElement.removeAttribute("class");
  55. }
  56. document.addEventListener("MozReftestInvalidate", doTest, false);
  57. </script>