Re: [csswg-drafts] [scroll-animations] ScrollTimeline fill-mode has asymmetric interaction with animation fill modes. (#4325)

The discussion for this issue happened mostly on #2066 (In particular see this [comment](
https://github.com/w3c/csswg-drafts/issues/2066#issuecomment-577424074)).

I will summarize my understanding of the consensus here:

- Remove ScrollTimeline.fill
- Introduce readonly attribute [timeline](https://drafts.csswg.org/web-animations-1/#animationtimeline) state in Web-Animation that can be:  {`Inactive`, `BeforeStart`, `InRange`, `AfterEnd`}
- In the case of ScrollTimeline
  - `Inactive`: No source, or non-scroller source   => timeline.currentTime is undefined.
  - `BeforeStart`:  when scroll offset < start           => timeline.currentTime is 0
  - `InRange`:       when start <= scroll offset < end => timeline.currentTime is calculated based on existing formular.
  - `AfterEnd`:       when end <= scroll offset   => timeline.currenTime is timeRange.
- Update animation and animation effect [active time](https://drafts.csswg.org/web-animations-1/#active-time) and [phase](https://drafts.csswg.org/web-animations-1/#before-phase) calculation to take the timeline state into account. For example when a timeline is in `InBefore` state then all its running attached animation effect would be in their `before` phase as well and similarly for other states. In another word, the active time of an animation effect would be determined from both the state of its timeline and then the current time of its timeline. This needs to be formalized in more details.








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

Received on Wednesday, 12 February 2020 16:37:48 UTC