mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-18 17:12:54 +00:00
35 lines
1,016 B
HTML
35 lines
1,016 B
HTML
<!DOCTYPE html>
|
|
<div id="foo"></div>
|
|
<script src="../../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const foo = document.getElementById("foo");
|
|
|
|
let anim = foo.animate({}, { duration: Infinity });
|
|
anim.cancel();
|
|
anim.playbackRate = -1;
|
|
|
|
try {
|
|
anim.play();
|
|
} catch {
|
|
println("Cannot rewind an animation with an infinite effect end")
|
|
}
|
|
|
|
anim = foo.animate({}, {});
|
|
anim.play();
|
|
println(`play() leaves animation's startTime unresolved: ${anim.startTime === null}`);
|
|
|
|
anim = foo.animate({}, {});
|
|
let oldPromise = anim.ready;
|
|
anim.play();
|
|
if (Object.is(oldPromise, anim.ready))
|
|
println("play() does not recreate the animation's ready promise");
|
|
|
|
anim = foo.animate({}, {});
|
|
anim.play();
|
|
anim.ready.catch(() => {
|
|
println("play() does not synchronously resolve the ready promise");
|
|
});
|
|
anim.cancel();
|
|
});
|
|
</script>
|