clipped-animated-transform-1.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="en" class="reftest-wait">
  3. <meta charset="utf-8">
  4. <title>The green box shouldn't be invalidated when the blue box starts to move.</title>
  5. <style>
  6. body {
  7. margin: 0;
  8. }
  9. #clip {
  10. border: 1px solid black;
  11. margin: 50px;
  12. overflow: hidden;
  13. height: 200px;
  14. width: 400px;
  15. position: relative;
  16. }
  17. #animatedTransform {
  18. border: 1px solid blue;
  19. width: 100px;
  20. height: 100px;
  21. position: absolute;
  22. z-index: 1;
  23. top: 50px;
  24. left: 50px;
  25. transition: transform ease-in-out .4s;
  26. }
  27. #clip:hover > #animatedTransform,
  28. #animatedTransform.animate {
  29. transform: translateX(200px);
  30. }
  31. #aboveTransform {
  32. position: relative;
  33. margin: 50px 100px;
  34. border: 1px solid lime;
  35. width: 80px;
  36. height: 80px;
  37. z-index: 2;
  38. }
  39. </style>
  40. <div id="clip">
  41. <div id="animatedTransform"></div>
  42. </div>
  43. <div id="aboveTransform" class="reftest-no-paint"></div>
  44. <script>
  45. function doTest() {
  46. document.getElementById("animatedTransform").className = "animate";
  47. document.documentElement.removeAttribute("class");
  48. }
  49. document.addEventListener("MozReftestInvalidate", doTest, false);
  50. </script>