csswg-drafts
csswg-drafts copied to clipboard
[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 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:
- We start with a time based animation effect with an
iteration count = 1,specified iteration duration = 1000,specified start delay = 0, andspecified end delay = 0. - The animation has it's timeline updated to a progress based timeline with a
duration = 100% - According to the algorithm we convert the time based animation to a proportional animation, using a total time of
1000msresulting initeration duration = 100%,start delay = 0%andend delay = 0% - We then update the timing of the effect with the same specified values (i.e.
specified iteration duration = 1000,specified start delay = 0, andspecified end delay = 0) - 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 computeiteration durationas1000 / 100 * 100%which is equal to1000%, not the expected100%
WebKit and Chromium both work around this by computing total time based on the specified values, ignoring the normalized ones.