Re: [csswg-drafts] [web-animations-1] Make animations become idle when they have an inactive timeline (#2066)

Thanks @birtles for reviewing!

> > https://drafts.csswg.org/scroll-animations-1/#current-time-algorithm - update ScrollTimeline.currentTime calculation as follows:
> 
> If current scroll offset is less than startScrollOffset, return (0 - epsilon) or -infinity.
> 
> If current scroll offset is greater than or equal to endScrollOffset, return ( effective time range + epsilon) or +infinity.
> 
> Consider: do we need explicitly address a case when startScrollOffset equals to endScrollOffset?
> 
> I want to avoid returning any epsilon values. That still leaves open the question of what is the current time of a timeline when it is in the new BeforeStart or AfterEnd states.
> 
> My intuition here is simply that it should be 0 or effective time range respectively. That can lead to bugs if script fails to check the timeline state, but given that it is the current time that will be used by those animations that are deemed to be active in those states, I think it's the most correct behavior.

Another option to consider is returning unresolved current time. Having BeforeStart and AfterEnd states lets the implementation apply desired animation fill mode. 

> Unfortunately, there are a lot of states to consider here. Ultimately we should really draw up a complete state chart of all the possible states and inputs (including the odd states like when a pending-pause is interrupted by a play() etc.) and reason from that, but that's quite a bit of work.

I agree with this assessment and will start a state diagram.

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

Received on Wednesday, 22 January 2020 19:29:30 UTC