pull-background-animated-position-4.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>This test fails - layerization should respect overflow:hidden clips around things with animated position</title>
  5. <style>
  6. div {
  7. min-height: 50px;
  8. box-model: border-box;
  9. }
  10. .first, .second {
  11. border: 1px solid blue;
  12. margin: 50px 0;
  13. position: relative;
  14. }
  15. .border {
  16. border: 1px solid black;
  17. }
  18. .clip {
  19. height: auto;
  20. overflow: hidden;
  21. padding: 10px 0 20px;
  22. }
  23. .animated-position {
  24. position: relative;
  25. left: 20px;
  26. margin-left: 220px;
  27. width: 100px;
  28. height: 100px;
  29. border-color: red;
  30. }
  31. body {
  32. margin: 0;
  33. padding: 0 100px;
  34. height: 3000px;
  35. }
  36. </style>
  37. <div class="first" reftest-assigned-layer="page-background">
  38. <!--
  39. This is just a regular box, it should end up in the page background layer.
  40. -->
  41. </div>
  42. <div class="clip border">
  43. <div class="border animated-position reftest-no-paint reftest-opaque-layer">
  44. <!--
  45. The background of .clip is uniform and opaque,
  46. .animated-position should be able to pull up that background color and
  47. become opaque itself.
  48. However, since this clip is not created by an animated geometry root that
  49. is a scrollable frame, we currently fail to recognize it, so this test
  50. will fail.
  51. -->
  52. </div>
  53. </div>
  54. <div class="second" reftest-assigned-layer="page-background">
  55. <!--
  56. This should share a layer with .first and the page background.
  57. However, since we don't recognize that .animated-position is contained in
  58. a clip, .second gets its own layer above .animated-position, so this test
  59. will fail.
  60. -->
  61. </div>
  62. <script>
  63. var animatedLeft = document.querySelector(".animated-position");
  64. function doTest() {
  65. animatedLeft.style.left = "-40px";
  66. document.documentElement.removeAttribute("class");
  67. }
  68. // Layerize #animatedLeft
  69. animatedLeft.offsetLeft;
  70. animatedLeft.style.left = "40px";
  71. animatedLeft.offsetLeft;
  72. animatedLeft.style.left = "60px";
  73. animatedLeft.offsetLeft;
  74. document.addEventListener("MozReftestInvalidate", doTest, false);
  75. setTimeout(doTest, 200);
  76. </script>