[csswg-drafts] [web-animations-2] The handle of zero or inf total time when we convert a time-based animation to a proportional animation (#7459)

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

== [web-animations-2] The handle of zero or inf total time when we convert a time-based animation to a proportional animation ==
There are two edge cases the spec doesn't specify what happen when we [convert a time-based animation to a proportional animation in [web-animations-2]](https://drafts.csswg.org/web-animations-2/#time-based-animation-to-a-proportional-animation):
> Set [start delay](https://drafts.csswg.org/web-animations-2/#start-delay) to be the result of evaluating specified start delay / total time * timeline duration.
> Set [iteration duration](https://drafts.csswg.org/web-animations-1/#iteration-duration) to be the result of evaluating specified iteration duration / total time * timeline duration.
> Set [end delay](https://drafts.csswg.org/web-animations-1/#end-delay) to be the result of evaluating specified end delay / total time * timeline duration.

This spec issue may be related to #4862, the normalization of progress-based animations. I notice Chromium handles these two edge cases by ([code](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/animation/animation_effect.cc;l=85-107;drc=33e617745ebc1094d350a18e56c5ab27a6aa511b)):
1. if the total time (i.e. end time) is zero, the start delay, end delay, and the iteration duration are all zero.
2. if the total time is inf, that start delay and end delay are zero, and the iteration duration is `1 / iteration count`.

The handle in Chromium looks reasonable to me, I'd like to use this similar way in Gecko. And it'd better to address these two edge cases in the spec as well.

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


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

Received on Wednesday, 6 July 2022 00:03:11 UTC