Revision control

1
<style>
2
3
#target {
4
position: absolute;
5
top: 0;
6
left: 0;
7
width: 100px;
8
height: 100px;
9
background-color: black;
10
}
11
12
</style>
13
<div id="target"></div>
14
<script src="../resources/ui-helper.js"></script>
15
<script>
16
17
(async () => {
18
if (window.testRunner)
19
testRunner.waitUntilDone();
20
21
// Start an animation that lasts a day.
22
const duration = 24 * 60 * 60 * 1000;
23
const target = document.getElementById("target");
24
const animation = target.animate({ translate: "200px" }, duration);
25
animation.currentTime = duration / 2;
26
27
// Wait until the animation has been applied.
28
await animation.ready;
29
await UIHelper.ensureStablePresentationUpdate();
30
31
// Change the transform property.
32
target.style.transform = "translateY(100px)";
33
34
// Wait until that change was made.
35
await UIHelper.ensureStablePresentationUpdate();
36
37
if (window.testRunner)
38
testRunner.notifyDone();
39
})();
40
41
</script>