commit 8660dd1fef109bf4c73ff22cfadd4fe4c9b71053
parent 231bd8786cf6795df769988bc8fbfd212786c522
Author: Kevin Ellis <kevers@google.com>
Date: Tue, 21 Oct 2025 10:29:17 +0000
Bug 1994489 [wpt PR 55458] - [waapi] Avoid computed undefined progress, a=testonly
Automatic update from web-platform-tests
[waapi] Avoid computed undefined progress
When setting the timeline of an animation we compute the current
progress based on the old timeline to that we can align the progress
on the new timeline if required. There are various cases where
the current progress could be undefined. In this case, we should not
be trying to preserve it.
Bug: 440368332
Change-Id: I62685326ae1a313acbeb027aba811f7c4e8b39e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7042167
Reviewed-by: David Awogbemila <awogbemila@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1530378}
--
wpt-commits: 728b80fdcd18474044dba7573295a24dedca32a6
wpt-pr: 55458
Diffstat:
1 file changed, 40 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/web-animations/crashtests/set-timeline-undefined-progress.html b/testing/web-platform/tests/web-animations/crashtests/set-timeline-undefined-progress.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html class="test-wait">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Set timeline when effect end is infinite.
+ </title>
+ <!-- crbug.com/440368332 -->
+</head>
+<style>
+ #target {
+ background-color: green;
+ width: 200px;
+ height: 200px;
+ }
+</style>
+<script>
+</script>
+<body>
+ <div id="target"></div>
+</body>
+<script>
+ window.onload = async () => {
+ const anim =
+ target.animate(null, { duration: 2000, iterations: Infinity });
+ // Setting an infinite playback rate combined with a future start time, puts
+ // current time infinitely in the past.
+ anim.playbackRate = Number.MAX_VALUE;
+ anim.startTime = performance.now() + 1000;
+ // When setting a new timeline, we compute the current progress on the old
+ // timeline in case we need to match the progress on the new timeline to
+ // avoid a jump. In this case, current progress is:
+ // currentTime / EffectEnd = -infinity / infinity = undefined.
+ anim.timeline = null;
+ requestAnimationFrame(() => {
+ document.documentElement.classList.remove('test-wait');
+ });
+ }
+</script>
+</html>