[csswg-drafts] [web-animations-2] Support setting animation currentTime and startTime using CSSNumericValue (#6458)

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

== [web-animations-2] Support setting animation currentTime and startTime using CSSNumericValue ==
The process for setting animation currentTime and startTime needs to be updated to handle CSSNumericValue inputs.

For progress based animations, I suggest we only allow CSSNumericValues that are percentages. which makes setting the time as simple as:
`(new_current_time / 100) * timeline_duration`

There are certain edge cases where we might be able to convert absolute time units to progress based values, but it would never be complete. If the animation is creating using only percentage values for effect iteration duration, then there is no frame of reference to be able to convert an absolute time value into a progress based value. I think it is more straightforward to simply limit the allowed input types depending on the type of timeline being used.

For time based animations we should add support for certain types of CSSNumericValues. At first glance it seems reasonable to support: Number, Milliseconds, Seconds, Integer. Time unit value for Number and Integer would be assumed to be in Milliseconds since that is the time value of absolute units already. Seconds would need to be converted.

Exceptions should be thrown at each point where incompatible input is detected.

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


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

Received on Friday, 16 July 2021 18:03:55 UTC