1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

LibWeb: Add a few Animation property tests

This commit is contained in:
Matthew Olsson 2024-03-07 09:48:26 -07:00 committed by Alexander Kalenik
parent d76c2d45c4
commit d7ad134ae5
8 changed files with 110 additions and 0 deletions

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<div id="foo"></div>
<script src="../../include.js"></script>
<script>
test(() => {
const foo = document.getElementById("foo");
let animation = foo.animate({ color: ["red", "blue"] });
println(`Element.animate creates Animation with effect: ${animation.effect instanceof KeyframeEffect}`);
animation.effect = null;
println(`Setting effect to null clears the effect: ${animation.effect === null}`);
animation = new Animation(null, null);
println(`Accessing effect property on animation with no effect produces null: ${animation.effect === null}`);
animation.effect = new KeyframeEffect(foo, {});
println(`Setting effect on animation with no effect works: ${animation.effect instanceof KeyframeEffect}`);
});
</script>