46 lines
1.2 KiB
HTML
46 lines
1.2 KiB
HTML
<!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>
|