layer-splitting-7.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait"
  3. reftest-displayport-x="0"
  4. reftest-displayport-y="0"
  5. reftest-displayport-w="800"
  6. reftest-displayport-h="1000">
  7. <meta charset="utf-8">
  8. <title>Scrolling shouldn't invalidate the relatively-positioned layer</title>
  9. <style>
  10. .content {
  11. box-sizing: border-box;
  12. width: 200px;
  13. height: 200px;
  14. border: 1px solid black;
  15. }
  16. .fixed {
  17. position: fixed;
  18. top: 20px;
  19. left: 20px;
  20. }
  21. .reftest-no-paint {
  22. border-color: lime;
  23. }
  24. .distanceFromTop {
  25. margin-top: 240px;
  26. }
  27. .relative {
  28. position: relative;
  29. }
  30. body {
  31. margin: 0;
  32. padding: 20px;
  33. height: 3000px;
  34. }
  35. </style>
  36. <div class="fixed reftest-no-paint content">
  37. <!--
  38. This fixed layer gets its own PaintedLayer above the page.
  39. It shouldn't attempt to pull up an opaque background color from the page,
  40. because the page can move under it.
  41. -->
  42. </div>
  43. <div class="distanceFromTop relative reftest-no-paint content">
  44. <!--
  45. This item is above .fixed in z-order, but it starts out not intersecting
  46. .fixed. It should still get its own layer from the start, because it can
  47. get scrolled on top of .fixed.
  48. -->
  49. </div>
  50. <script>
  51. function doTest() {
  52. document.documentElement.scrollTop = 100;
  53. document.documentElement.removeAttribute("class");
  54. }
  55. document.documentElement.scrollTop = 0;
  56. document.addEventListener("MozReftestInvalidate", doTest, false);
  57. </script>