| animation: move 150ms linear 2; |
| from { transform: translateX(0); } |
| to { transform: translateX(500px); } |
| testRunner.waitUntilDone(); |
| window.addEventListener("load", () => { |
| if (!window.internals || !window.testRunner) |
| const box = document.getElementById("box"); |
| const result = document.getElementById("result"); |
| box.addEventListener("animationstart", () => internals.startTrackingStyleRecalcs()); |
| box.addEventListener("animationiteration", () => result.innerText = "Got iteration event.\n"); |
| box.addEventListener("animationend", () => { |
| const numRecalcs = internals.styleRecalcCount(); |
| result.innerText += "FAIL: saw " + numRecalcs + " style recalcs during the animation, should only see three." |
| result.innerText += "PASS: saw three or fewer style recalcs during the animation." |
| box.classList.add("animating"); |