blob: efee1576f00e89569250dd4ffbe3a347d4fdb6d1 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style>
#target {
width: 100px;
height: 100px;
background-color: black;
}
</style>
</head>
<body>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="target"></div>
<script>
function waitNFrames(numberOfFrames, continuation)
{
let elapsedFrames = 0;
(function rAFCallback() {
if (elapsedFrames++ >= numberOfFrames)
continuation();
else
requestAnimationFrame(rAFCallback);
})();
}
async_test(t => {
const keyframes = { transform: ["translateX(50px)", "translateX(100px)"] };
const timing = { duration: 50, fill: "forwards" };
document.getElementById("target").animate(keyframes, timing).addEventListener("finish", event => {
const numberOfTimelineInvalidationsWhenFinished = internals.numberOfAnimationTimelineInvalidations();
waitNFrames(3, () => {
assert_equals(internals.numberOfAnimationTimelineInvalidations(), numberOfTimelineInvalidationsWhenFinished + 1);
t.done();
});
});
}, "There should not be more than one update made to the timeline after a forward-filling accelerated animation completes.");
</script>
</body>
</html>