-
Notifications
You must be signed in to change notification settings - Fork 707
[scroll-animations-1][web-animations-2] getCurrentTime is self-inconsistent wrt representing time #8765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can see that as an author you’d sometimes want to know the relative “time” (i.e. a percentage) and sometimes you’d want the absolute “time”. We could go with two different methods Side note: seeing that I put time between quotes in the previous paragraph and @fantasai used the word “progress” – and I also hinted at it here – maybe it’s better to rename the method to |
@bramus ... so maybe we want parallel
|
/ping @flackr to get your take on this. I think this needs to be tackled before shipping. |
I agree this should be resolved before shipping. I wonder how important the API even is? Do authors need it? Is it needed for WPT? If we're not sure what the ergonomics/naming/use cases are for this, would it make sense to ship without it? |
I agree with @birtles that I think this is purely additive to scroll driven animations and doesn't need to be part of the initial API. I'm in favor of shipping without it and adding it later. |
The use cases I've seen presented for this have been about matching an animation's progress at which point it seems like we should provide an animation-wide progress or suggest developers access the effect progress rather than trying to make an API which usually aligns with an animation effect. That said, if we think an API is needed on the timeline for use cases which aren't trying to match an animation progress, I would suggest using terminology like progress if we are going to return progress through a range rather than an absolute time. |
So we resolved to add .progress to the Animation API in #8799 ; but that still leaves this issue open. If we're deferring |
So long as we don't have a strong use case (it seems like |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> flackr: We've had a bunch of debate about best way getCurrentTime on a timeline should work, if needed, what are use cases. Resolve dto add progress to animation to handle common use case<dael> flackr: With that, think we should remove getCurrentTime from the APIa nd re-add when we have clearer sense of use cases <dael> fantasai: I'm fine with deferring. It means there is no real way to figure out where you are in a timeline range. So you don't know when unless you make an animation and measure progress. We don't have API to say how ranges relate to rest of timeline <dael> fantasai: But I'm fine with deferring. Not a problem <dael> Rossen_: Anyone else? <dael> Rossen_: Objections to defer on getCurrentTime <dael> RESOLVED: Defer on getCurrentTime for L1 <dael> Rossen_: I'm assuming bramus is on same page as you? I don't see us doing a disservice for any commentor |
Renaming the relevant set as |
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:
currentTime
, and name it accordingly as @birtles suggests in [scroll-animations-1] Animation.getCurrentTime is easily confused with Animation.currentTime #8201.currentTime
) in relation to a named range.I'm not sure which direction we want to go... @bramus, thoughts?
The text was updated successfully, but these errors were encountered: