| <!DOCTYPE HTML> |
| <html> |
| <head> |
| <script src="../resources/js-test-pre.js"></script> |
| <style> |
| #box { |
| width: 100px; |
| height: 100px; |
| background-color: silver; |
| } |
| |
| #box.animating { |
| animation: spinner 0.25s steps(2) 1; |
| } |
| |
| @keyframes spinner { |
| from { transform: rotate(0deg); } |
| to { transform: rotate(360deg); } |
| } |
| </style> |
| <script> |
| window.jsTestIsAsync = true; |
| |
| let count = 0; |
| window.addEventListener('load', () => { |
| let box = document.getElementById('box'); |
| box.addEventListener('animationstart', () => { |
| if (window.internals) |
| internals.startTrackingCompositingUpdates(); |
| shouldBe('count', '0'); |
| }, false); |
| box.addEventListener('animationend', () => { |
| if (window.internals) |
| count = internals.compositingUpdateCount(); |
| shouldBeTrue('count < 6'); |
| finishJSTest(); |
| }, false); |
| |
| box.classList.add('animating'); |
| }, false); |
| </script> |
| </head> |
| <body> |
| <div id="box"></div> |
| <div id="console"></div> |
| <script src="../resources/js-test-post.js"></script> |
| </body> |
| </html> |