csswg-drafts icon indicating copy to clipboard operation
csswg-drafts copied to clipboard

[web-animations-2] Incorrect value for total time in "convert a time based animation to a proportional animation"

Open Calme1709 opened this issue 2 weeks ago • 0 comments

Step 1 of the second branch of convert a 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 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 and Chromium both work around this by computing total time based on the specified values, ignoring the normalized ones.

Calme1709 avatar Dec 17 '25 11:12 Calme1709