mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
29 lines
1.2 KiB
HTML
29 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<div id="foo"></div>
|
|
<script src="../../include.js"></script>
|
|
<script>
|
|
promiseTest(async () => {
|
|
const foo = document.getElementById("foo");
|
|
|
|
let animation = new Animation(null, null);
|
|
println(`Animation with no timeline has null currentTime: ${animation.currentTime === null}`);
|
|
|
|
animation = new Animation(new KeyframeEffect(foo, []));
|
|
println(`Animation that hasn't been played has null currentTime: ${animation.currentTime === null}`);
|
|
|
|
animation = foo.animate({ color: "red" }, { duration: 1000 });
|
|
println(`Played animation has a currentTime of 0: ${animation.currentTime === 0}`);
|
|
|
|
await timeout(100);
|
|
|
|
// FIXME: Figure out how to consistently test timings
|
|
// if (animation.currentTime > 95 && animation.currentTime < 105)
|
|
// println("Animation time after 100ms is correct");
|
|
|
|
animation = foo.animate({ opacity: [0, 1] }, { duration: 1000 });
|
|
println(`New animation has not started animating: ${getComputedStyle(foo).opacity === "0"}`);
|
|
animation.currentTime = 1000;
|
|
println(`Animation with currentTime set to end is finished: ${getComputedStyle(foo).opacity === "1"}`);
|
|
});
|
|
</script>
|