Re: [csswg-drafts] [web-animations-1] Fixed play animation procedure for scroll animations (#2075) (#5059)

Looking at the first failure (will address second in followup post):

// Schedule animation to start playing. 
animation.play();  

// Update the hold time since we don’t yet have a start time. Pending pauses are
// synchronously resolved, perhaps pending plays should be as well.
animation.currentTime = 2000;  

// Change pending playback rate to -1 and trigger the steps to play an animation
// with auto-rewind set to true.  Here we have a difference between finite
// and monotonic timelines. Finite sets the start time, whereas monotonic sets the
// hold time. Setting either hold or start time does not unresolve its counterpart.
// It appears we can get into a state with both hold time and start time resolved,
// which is normally only possible when in the finished state.  If hold time = 2000
// but start time = 1000, then current time = 2000.
animation.reverse();

Ensuring that hold time is cleared whenever start time is set should resolve this problem. Since we update the finished state as the last step in the process, we don't need to worry about clearing the hold time if the animation is finished (it'll simply be re-resolved).



-- 
GitHub Notification of comment by kevers-google
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/5059#issuecomment-629360042 using your GitHub account

Received on Friday, 15 May 2020 16:37:16 UTC