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

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

From: Olga Gerchikov via GitHub <sysbot+gh@w3.org>
Date: Mon, 11 May 2020 20:03:46 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-626928324-1589227425-sysbot+gh@w3.org>
Here are the failing tests you requested.
- reverse() example:
```
promise_test(async t => {
  const animation = createScrollLinkedAnimation(t); // duration: 1000
  // Wait for new animation frame which allows the timeline to compute new
  // current time.
  await waitForNextFrame();
  animation.play();
  animation.currentTime = 2000;
  // play() invoked by reverse() sets start time to 1000 based on the
  // effective playback rate, which is -1.
  animation.reverse(); 
  // This fails. Current time is calculated based on playback rate, which is 1.
  assert_equals(animation.currentTime, 1000, 
    'reverse() should start playing from the animation effect end ' +
    'if the playbackRate > 0 and the currentTime > effect end');
}, 'Reversing an animation when playbackRate > 0 and currentTime > ' +
   'effect end should make it play from the end');
```
- Re-playing finished animation
```
promise_test(async t => {
  const animation = createScrollLinkedAnimation(t); // duration: 1000
  // Wait for new animation frame  which allows the timeline to compute new
  // current time.
  await waitForNextFrame();
  animation.play();
  animation.finish();
  assert_time_equals_literal(animation.currentTime, 1000);
  animation.play();
  // This fails. Finished animation has both start and hold time set. 
  // Start time is initialized to zero, but later it's cleared since the hold time is set.
  assert_time_equals_literal(animation.currentTime, 0); 
}, 'Playing a finished animation seeks back to the start');
```

-- 
GitHub Notification of comment by ogerchikov
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/5059#issuecomment-626928324 using your GitHub account
Received on Monday, 11 May 2020 20:04:35 UTC

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