Revision control

1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style>
5
6
#target {
7
width: 100px;
8
height: 100px;
9
background-color: black;
10
}
11
12
</style>
13
</head>
14
<body>
15
<script src="../resources/testharness.js"></script>
16
<script src="../resources/testharnessreport.js"></script>
17
<div id="target"></div>
18
<script>
19
20
function waitNFrames(numberOfFrames, continuation)
21
{
22
let elapsedFrames = 0;
23
(function rAFCallback() {
24
if (elapsedFrames++ >= numberOfFrames)
25
continuation();
26
else
27
requestAnimationFrame(rAFCallback);
28
})();
29
}
30
31
async_test(t => {
32
const keyframes = { marginLeft: ["50px", "100px"] };
33
const timing = { duration: 50, fill: "forwards" };
34
document.getElementById("target").animate(keyframes, timing).addEventListener("finish", event => {
35
const numberOfTimelineInvalidationsWhenFinished = internals.numberOfAnimationTimelineInvalidations();
36
waitNFrames(2, () => {
37
assert_equals(internals.numberOfAnimationTimelineInvalidations(), numberOfTimelineInvalidationsWhenFinished);
38
t.done();
39
});
40
});
41
}, "There should not be any updates made to the timeline after a forward-filling animation completes.");
42
43
</script>
44
</body>
45
</html>