layer-splitting-1.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>Moving the transform under the absolutely-positioned layer should cause that to invalidate</title>
  5. <style>
  6. .content {
  7. box-sizing: border-box;
  8. width: 200px;
  9. height: 200px;
  10. border: 1px solid black;
  11. }
  12. .absolute {
  13. position: absolute;
  14. z-index: 2;
  15. top: 20px;
  16. left: 240px;
  17. }
  18. .reftest-no-paint {
  19. border-color: lime;
  20. }
  21. .transform {
  22. will-change: transform;
  23. }
  24. body {
  25. margin: 0;
  26. padding: 20px;
  27. height: 3000px;
  28. }
  29. </style>
  30. <div class="transform content" id="aboutToMoveUnderAbsolute">
  31. <!--
  32. This transform is active + prerendered, and will move under the
  33. absolutely-positioned item.
  34. -->
  35. </div>
  36. <div class="absolute reftest-no-paint content">
  37. <!--
  38. This absolutely-positioned element should get its own PaintedLayer above the
  39. transform.
  40. It shouldn't attempt to pull up an opaque background color from the page,
  41. because the transform can move under it.
  42. -->
  43. </div>
  44. <script>
  45. function doTest() {
  46. document.querySelector("#aboutToMoveUnderAbsolute").style.transform = "translateX(100px)";
  47. document.documentElement.removeAttribute("class");
  48. }
  49. document.addEventListener("MozReftestInvalidate", doTest, false);
  50. </script>