| <!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', () => { |
| if (!window.internals) { |
| finishJSTest(); |
| return; |
| } |
| |
| let box = document.getElementById('box'); |
| box.addEventListener('animationstart', () => { |
| internals.startTrackingRenderingUpdates(); |
| shouldBe('count', '0'); |
| }, false); |
| box.addEventListener('animationend', () => { |
| count = internals.renderingUpdateCount(); |
| 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> |