animate-preserve3d-child.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!DOCTYPE HTML>
  2. <html class="reftest-wait">
  3. <title>Testcase, bug 1176969</title>
  4. <style>
  5. body { padding: 50px }
  6. #grandparent { perspective: 400px }
  7. @keyframes spin {
  8. 0%, 85% { transform: rotateX(-45deg) rotateY(-45deg) rotateZ(-45deg); }
  9. 90%, 100% { transform: rotateX(-30deg) rotateY(-30deg) rotateZ(-30deg); }
  10. }
  11. #parent {
  12. background: blue;
  13. height: 200px; width: 200px;
  14. border: 1px solid black;
  15. transform-style: preserve-3d;
  16. /* use a -99.9s delay to start at 99.9% and then move to 0% */
  17. animation: spin 100s -99.9s linear 2;
  18. }
  19. @keyframes noop {
  20. from, to { transform: translateZ(15px) }
  21. }
  22. #child {
  23. height: 100px; width: 100px; margin: 50px;
  24. background: yellow;
  25. box-shadow: 3px 3px olive;
  26. animation: noop infinite 10s linear;
  27. }
  28. </style>
  29. <div id="grandparent">
  30. <div id="parent">
  31. <div id="child">
  32. </div>
  33. </div>
  34. </div>
  35. <script>
  36. document.getElementById("parent").addEventListener("animationiteration", IterationListener, false);
  37. function IterationListener(event) {
  38. setTimeout(RemoveReftestWait, 0);
  39. }
  40. function RemoveReftestWait() {
  41. document.documentElement.classList.remove("reftest-wait");
  42. }
  43. </script>