Re: [csswg-drafts] [scroll-animations-1] currentTime for animations attached to a timeline attachment range (#8669)

> I'm not sure mapping `animation.progress` to `animation.effect.getComputedTiming().progress` is a good idea.
> 
> The returned value is based on the various timing properties of the of rootmost effect so it feels like a layering violation to make it look like a property of the animation.

I agree, see below.

> Admittedly, we do something similar when we report an animation as "finished" since the point in time at which it finishes is based on the timing of its rootmost effect, if any but we've very deliberately chosen to make that compromise for that specific case and we've gone all in on it, adding `finish()`, `finished` and finish events.
> 
> I'm not sure if reporting the iteration progress for the rootmost effect deserves that kind of treatment, especially because it is the _iteration_ progress.
> 
> If we need something to report the fraction from where an animation starts to where it finishes, maybe we should introduce a new concept for that (e.g. "animation progress") and expose that instead? Such a value would presumably be independent of any delays etc. specified on the rootmost effect.

Yeah I was thinking that if we did introduce something like this it could be the overall animation progress through the [active interval](https://www.w3.org/TR/web-animations-1/#the-active-interval). It would of course then have to be undefined for an animation with infinite iterations.

Another thing that might have made @bramus's use case simpler is if iteration progress were accessible without needing to call getComputedTiming(), e.g. `animation.effect.progress`.

> I guess it depends on what the ultimate use case is for this?

I agree we should think about what the particular use case is for this to make sure we're looking at this in the context of how it will be used. If it's for demos such as the one that this issue was filed for I suspect the root effect's iteration progress is what's expected - but then I agree with @birtles that it should be on the root effect and not on the animation.

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8669#issuecomment-1503336918 using your GitHub account


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

Received on Tuesday, 11 April 2023 13:17:44 UTC