Re: [csswg-drafts] [scroll-animations-1] Effects for scroll linked animations are not inclusive at max scroll (#5223)

Given that we need to change the animation and effect timing calculation to change, I would argue it is probably better to no longer have the current special-case logic on ScrollTimeline. Basically just have it so that once timeline reaches its last position it is in "after" phase which is the normal behavior.

Then we just make the keyframe to have a fill forward or act as if it has one. If keyframe already has explicitly a fill value we honor that which allows authors a way to escape this behavior.

Basically I propose something like this:
 - Consider ScrollTimeline with scroll range 100% to be *terminal finite*. (I am sure there are probably better terms for this but I am just using this to just mean that it is not possible to go beyond their last time value).
 - When [setting timeline of an animation](https://drafts.csswg.org/web-animations/#setting-the-timeline), it that timeline is *terminal finite*, then consider that animation to be *prefers fill-forward*.
 - When [setting the associate effect](https://drafts.csswg.org/web-animations/#setting-the-associated-effect), if the animation is a *prefers fill-forward* and the effect's fill mode was not explicitly specified (we may need to introduce 'fill: auto' as a default value), then set the effect's fill to be forward.

I believe this:
 - achieves the desired behavior.
 - is author friendly (observable and overridable via effect.phase and).
 - is simple to understand and spec since it avoids the special case in timeline phase.




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

Received on Tuesday, 14 July 2020 19:09:58 UTC