paintedlayer-recycling-4.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>Removing an existing display item from 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. #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 a PaintedLayer 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, in the same layer as the other .onTopOfFixed item.
  43. -->
  44. </div>
  45. <div class="onTopOfFixed reftest-no-paint content">
  46. <!--
  47. This item shouldn't repaint when the other .onTopOfFixed item becomes invisible.
  48. -->
  49. </div>
  50. <script>
  51. function doTest() {
  52. document.querySelector("#aboutToBecomeHidden").style.visibility = "hidden";
  53. document.documentElement.removeAttribute("class");
  54. }
  55. document.addEventListener("MozReftestInvalidate", doTest, false);
  56. </script>