Re: [csswg-drafts] [web-animations-2] Progress APIs (#8799)

On the PR from @DavMila there is one point where we don't have a clear answer. Should the progress be clamped to [0, 1]. For the full discussion you can view the PR review https://github.com/w3c/csswg-drafts/pull/9937#discussion_r1491825782 however I'll do my best to summarize the pros and cons of each.

1. Don't clamp the progress. This makes it similar to the currentTime which progress exists alongside (which also can be negative or greater than end time) and is the natural result of the expressed formula. This could be useful for example to distinguish between being at the start time (progress = 0) where the effect is active and visibly shown, and being before the start time (progress < 0) where the effect is not applied (unless `fill = backwards | both`). However, this also means that to correctly reflect the progress for 0 duration animations we would likely have to return `-Infinity` and `Infinity` when you are before or at/after the start time respectively.
2. Clamp the progress to [0, 1]. A developer won't be able to tell when at 0 progress whether the animation is active or not without also checking whether the currentTime is less than the start time. We could consider adding another member to animation to reflect this in the future.

Ultimately, I think either works, but which is better comes back to how authors will use this. @bramus @fantasai @birtles any thoughts?

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


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

Received on Thursday, 29 February 2024 16:13:36 UTC