mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
It is not guaranteed that an animation is ready to run a pending task when it is scheduled just because it has a timeline, and even if it is, the current time when scheduling will not necessarily still be correct when the task is run (e.g. if the timeline changes in the interim). We had some tests which relied on the previous behavior which have been updated to await the pending play task Fixes a crash in the /web-animations/interfaces/Animatable/animate-no-browsing-context.html WPT test but it can't be imported since it relies on a python web server to be running
18 lines
507 B
HTML
18 lines
507 B
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<div id="foo"></div>
|
|
<script>
|
|
(async () => {
|
|
const anim = new Animation(new KeyframeEffect(foo, [{ rotate: "0deg" }, { rotate: "360deg" }]));
|
|
|
|
// Ensure that the animation has no timeline when calling the play method
|
|
anim.timeline = null;
|
|
anim.play();
|
|
|
|
// Tick `notify_timeline_time_did_change` to run the pending play task
|
|
anim.timeline = document.timeline;
|
|
})();
|
|
</script>
|
|
</html>
|