layer-splitting-5.html 2.3 KB

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