W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2020

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

From: Olga Gerchikov via GitHub <sysbot+gh@w3.org>
Date: Wed, 04 Mar 2020 20:57:50 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-594835646-1583355469-sysbot+gh@w3.org>
Based on the animation state charts provided above, here is the essence of the proposal for handling inactive timelines:
- If animation.play() or animatio.pause() is called with inactive timeline, instead of initializing hold_time to zero, set start_time to zero. This produces unresolved animation current time and, as a result, animation effect is not applied.
- Execute animation pending pause task when inactive timeline becomes active. This makes ready time resolved at the time of the execution and, as a result, produces resolved hold_time.
- Currently setting current time of running animation when the timeline is inactive makes the animation transition to paused state. To keep the animation running, the proposal is to queue a play pending task which is executed as soon as the timeline becomes active.
```javascript
animation = new Animation(new KeyframeEffect(...}],
                                             { duration: 2000}), document.timeline);
animation.play();
await animation.ready;
animation.timeline = null;
console.log(animation.currentTime); //null 
animation.currentTime = 500;
console.log(animation.playState);  // running because the animation has play pending task
animation.timeline = document.timeline;
await animation.ready;
console.log(animation.playState);  //running
```


-- 
GitHub Notification of comment by ogerchikov
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2066#issuecomment-594835646 using your GitHub account
Received on Wednesday, 4 March 2020 20:57:52 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:02 UTC