LibWeb: Account for pending playback rate changes when playing animation

The spec calls for us to use the effective playback rate (i.e. including
any pending updates) when playing an animation.

Fixes a timeout in the newly imported test.
This commit is contained in:
Callum Law
2025-12-14 23:52:06 +13:00
committed by Alexander Kalenik
parent 16d1498bb0
commit d1e8788d43
Notes: github-actions[bot] 2025-12-23 13:56:14 +00:00
6 changed files with 299 additions and 11 deletions

View File

@@ -23,14 +23,13 @@
anim = foo.animate({}, { duration: Infinity });
anim.cancel();
anim.playbackRate = -1;
try {
// anim.play() would throw here
anim.reverse();
} catch {
println("Cannot reverse an animation with an infinite effect end");
}
if (anim.playbackRate === -1)
if (anim.playbackRate === 1)
println("reverse() does not update the playback rate if calling play() would throw an exception");
});
</script>