[scroll-animations-1][web-animations-2] getCurrentTime is self-inconsistent wrt representing time · Issue #8765 · w3c/csswg-drafts (original) (raw)

In order to represent time in relation to named timeline ranges, we have two options:

If we consider its default behavior as returning the time with respect to a timeline range that encompasses the entire timeline, the current definition for getCurrentTime() switches between the two modes depending on whether you specify a range name or not. (!)

This doesn't feel unnatural to scroll timelines, because their “absolute timeline units” are percentages of the timeline (which itself has a finite range)... We would probably have noticed the discrepency sooner if they used length-based time. :/

But it runs into problems if we extend the named timeline concept to other types of timelines, such as time-based timelines. These bring in (potentially) two differences:

I think we might want to rethink this API. Some possible options:

I'm not sure which direction we want to go... @bramus, thoughts?