1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:47:35 +00:00
serenity/Tests/LibWeb/Text/input/WebAnimations/animation-properties/replaceState.html

23 lines
1 KiB
HTML

<!DOCTYPE html>
<div id="foo"></div>
<script src="../../include.js"></script>
<script>
// Note: The "persisted" state will be tested in the Animation.persist() test
asyncTest(async done => {
const foo = document.getElementById("foo");
const animation1 = foo.animate({ opacity: [0, 1] }, { duration: 10, fill: "forwards" });
println(`Animation's replaceState is active initially: ${animation1.replaceState === "active"}`);
await animation1.finished;
println(`Animation's replaceState is active after finishing: ${animation1.replaceState === "active"}`);
const animation2 = foo.animate({ opacity: [1, 0] }, { duration: 10, fill: "forwards" });
println(`Animation's replaceState is not removed after creating new animation: ${animation1.replaceState === "active"}`);
await animation2.finished;
println(`Animation's replaceState is removed after new animation finishes: ${animation1.replaceState === "removed"}`);
done();
});
</script>