layer-splitting-6.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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>Things overlapping active scrollboxes should be in a layer on top of the scrolled contents, and that layer shouldn't pull up a background color through the scrollbox.</title>
  9. <!--
  10. This test is the same as layer-splitting-5.html, but without the scrollbox
  11. border. The lack of a border here makes it attractive for .overlap to pull
  12. a background color from the page background (because there's no scrollbox
  13. border in the way), but it shouldn't do that because .scrolled can move
  14. under it.
  15. -->
  16. <style>
  17. div {
  18. height: 50px;
  19. border: 1px solid;
  20. box-model: border-box;
  21. }
  22. .first, .second {
  23. border-color: blue;
  24. margin: 50px 0;
  25. }
  26. .overlap {
  27. border-color: #088;
  28. margin-left: 100px;
  29. width: 80px;
  30. margin-bottom: -30px;
  31. position: relative;
  32. }
  33. .scrollable {
  34. height: auto;
  35. overflow: auto;
  36. border: none;
  37. }
  38. .scrollarea {
  39. width: 5000px;
  40. border: none;
  41. padding: 10px 0 20px;
  42. height: auto;
  43. }
  44. .scrolled {
  45. margin-left: 220px;
  46. width: 100px;
  47. height: 100px;
  48. border-color: red;
  49. }
  50. body {
  51. margin: 0;
  52. padding: 0 100px;
  53. height: 3000px;
  54. }
  55. </style>
  56. <div class="first" reftest-assigned-layer="page-background">
  57. <!--
  58. This is just a regular box, it should end up in the page background layer.
  59. -->
  60. </div>
  61. <div class="overlap reftest-no-paint">
  62. <!--
  63. This item intersects with the scrollable box and is positioned above
  64. .scrolled, in z-order, so it should be split into its own layer as soon
  65. as the scrollbox gets active scrolling. The splitting should not wait for
  66. .scrolled to move under .overlap.
  67. -->
  68. </div>
  69. <div class="scrollable">
  70. <div class="scrollarea">
  71. <div class="scrolled reftest-opaque-layer">
  72. <!--
  73. This will move under .overlap by .scrollable being scrolled. This
  74. action should not invalidate .overlap.
  75. Furthermore, since the background of .scrollable is uniform and opaque,
  76. .scrolled should be able to pull up that background color and become
  77. opaque itself.
  78. -->
  79. </div>
  80. </div>
  81. </div>
  82. <div class="second" reftest-assigned-layer="page-background">
  83. <!--
  84. This should share a layer with .first and the page background.
  85. -->
  86. </div>
  87. <script>
  88. var scrollable = document.querySelector(".scrollable");
  89. function doTest() {
  90. scrollable.scrollLeft = 100;
  91. document.documentElement.removeAttribute("class");
  92. }
  93. // Make .scrollable start out with active scrolling.
  94. scrollable.scrollLeft = 0;
  95. scrollable.scrollLeft = 20;
  96. document.addEventListener("MozReftestInvalidate", doTest, false);
  97. </script>