Re: [csswg-drafts] [scroll-animations-1] [web-animations-2] Clarifying behavior of getCurrentTime(rangeName) (#8114)

> A few questions regarding getCurrnetTime(rangeName) in AnimationTimeline.
> 
> Why does the progress need to be constrained between 0 and 100%. If in the 'contain' range and asking for the currentTime of the 'enter' range, should we not return a value greater than 100%?

I suspect so. This matches the time used by an animation over that range.

> What if the range is zero? If I recall correctly, a zero 'cover' range should result in an inactive timeline, which is handled in the algorithm, but what if the enter / exit range is zero due to having a target element of height zero (axis: vertical) and then querying one of those ranges? Perhaps this is deserving of a "returns null". This example may seem contrived, but it is doable. How about the case when the target exceeds the viewport size and fetching the 'contain' progress? As we transition from the 'enter' to the 'exit' range, the cover range has a height or width of zero.

Zero range does not necessarily mean inactive. See https://github.com/w3c/csswg-drafts/issues/7778#issuecomment-1313875566 for details. We should follow the calculation we define there. Though interestingly, for 0 range as long as you can scroll before or after the 0 range it probably makes sense to have the progress by -infinity and +infinity so that if your effect fills it applies the fill effect based on which side you're on.

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


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

Received on Friday, 2 December 2022 19:58:38 UTC