paintedlayer-recycling-7.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>When a PaintedLayer is split up into two, the lower items should stay in their layer and the higher items should get a new one.</title>
  5. <!-- The motivation for this is that we don't ever want to assign a new layer to the canvas background just because an item is split from it. -->
  6. <style>
  7. .content {
  8. box-sizing: border-box;
  9. width: 200px;
  10. height: 200px;
  11. border: 1px solid black;
  12. }
  13. .fixed {
  14. position: fixed;
  15. top: 20px;
  16. left: 140px;
  17. }
  18. .onTopOfFixed {
  19. position: absolute;
  20. top: 120px;
  21. left: 260px;
  22. }
  23. .reftest-no-paint {
  24. border-color: lime;
  25. }
  26. .onTopOfFixed.reftest-no-paint {
  27. left: 20px;
  28. }
  29. body {
  30. margin: 0;
  31. padding: 20px;
  32. height: 3000px;
  33. }
  34. </style>
  35. <div class="fixed content">
  36. <!--
  37. This layer is just there to force .onTopOfFixed into PaintedLayers above
  38. the page background.
  39. -->
  40. </div>
  41. <div class="onTopOfFixed reftest-no-paint content">
  42. <!--
  43. This item should start out sharing a PaintedLayer with the other
  44. .onTopOfFixed item.
  45. -->
  46. </div>
  47. <div class="fixed content" id="aboutToBecomeVisible" style="visibility: hidden">
  48. <!--
  49. This layer starts out hidden. When it becomes visible, it forces the two
  50. .onTopOfFixed items into separate layers.
  51. -->
  52. </div>
  53. <div class="onTopOfFixed content">
  54. <!--
  55. This item should start out sharing a PaintedLayer with the other
  56. .onTopOfFixed item, but when the two items get split up, it should be this
  57. one that changes layers, not the other one.
  58. -->
  59. </div>
  60. <script>
  61. function doTest() {
  62. document.querySelector("#aboutToBecomeVisible").style.visibility = "visible";
  63. document.documentElement.removeAttribute("class");
  64. }
  65. document.addEventListener("MozReftestInvalidate", doTest, false);
  66. </script>