paintedlayer-recycling-1.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>Switching the transform to animate shouldn't invalidate the fixed layer</title>
  5. <style>
  6. .content {
  7. box-sizing: border-box;
  8. width: 200px;
  9. height: 200px;
  10. border: 1px solid black;
  11. }
  12. .fixed {
  13. position: fixed;
  14. background-color: white;
  15. top: 20px;
  16. left: 240px;
  17. }
  18. .reftest-no-paint {
  19. border-color: lime;
  20. }
  21. .transform {
  22. transform: translateY(0.1px);
  23. }
  24. .aboveTransform {
  25. margin-top: 20px;
  26. border-color: blue;
  27. position: relative;
  28. }
  29. body {
  30. margin: 0;
  31. padding: 20px;
  32. height: 3000px;
  33. }
  34. </style>
  35. <div class="transform content" id="aboutToAnimate">
  36. <!--
  37. This transform starts out inactive and is going to turn active + prerendered.
  38. -->
  39. </div>
  40. <div class="aboveTransform content">
  41. <!--
  42. This content is on top of .transform in z-order but starts out in the
  43. same layer as .transform (and the canvas background). Once the transform
  44. turns active, this needs its own PaintedLayer because the prerendered
  45. transform might asynchronously move underneath it.
  46. -->
  47. </div>
  48. <div class="fixed reftest-no-paint content">
  49. <!--
  50. This fixed layer gets its own PaintedLayer above the rest.
  51. When .aboveTransform requires its own PaintedLayer, it should not cause
  52. .fixed to change layers.
  53. -->
  54. </div>
  55. <script>
  56. function doTest() {
  57. document.querySelector("#aboutToAnimate").style.willChange = "transform";
  58. document.documentElement.removeAttribute("class");
  59. }
  60. document.addEventListener("MozReftestInvalidate", doTest, false);
  61. </script>