[csswg-drafts] [web-animations-2] Incorrect value for total time in "convert a time based animation to a proportional animation" (#13230)

Calme1709 has just created a new issue for https://github.com/w3c/csswg-drafts:

== [web-animations-2] Incorrect value for total time in "convert a time based animation to a proportional animation" ==
Step 1 of the second branch of [convert a time-based animation to a proportional animation](https://drafts.csswg.org/web-animations-2/#time-based-animation-to-a-proportional-animation) tells us to `Let total time be equal to end time` but this only works if this is the first time we are running this procedure.

Take for instance the following situation:
1. We start with a time based animation effect with an `iteration count = 1` , `specified iteration duration = 1000`, `specified start delay = 0`, and `specified end delay = 0`.
2. The animation has it's timeline updated to a progress based timeline with a `duration = 100%`
3. According to the algorithm we convert the time based animation to a proportional animation, using a total time of `1000ms` resulting in `iteration duration = 100%`, `start delay = 0%` and `end delay = 0%`
4. We then update the timing of the effect with the same specified values (i.e. `specified iteration duration = 1000`, `specified start delay = 0`, and `specified end delay = 0`)
5. Running the [convert a time-based animation to a proportional animation](https://drafts.csswg.org/web-animations-2/#time-based-animation-to-a-proportional-animation) again, we use the new end time (which is based on the normalized values) giving us a total time of `100%`, and therefore compute `iteration duration` as `1000 / 100 * 100%` which is equal to `1000%`, not the expected `100%`

[WebKit](https://github.com/graouts/WebKit/blob/138b68e85fc4a0050346b8b5f2deef331b7e453b/Source/WebCore/animation/AnimationEffectTiming.cpp#L35-L40) and [Chromium](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/animation/animation_effect.cc;l=105-115) both work around this by computing `total time` based on the specified values, ignoring the normalized ones.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13230 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 17 December 2025 11:06:47 UTC