- From: Antoine Quint via GitHub <sysbot+gh@w3.org>
- Date: Thu, 09 Jan 2025 17:36:44 +0000
- To: public-css-archive@w3.org
graouts has just created a new issue for https://github.com/w3c/csswg-drafts: == [web-animations-2] [scroll-animations] should calling `play()` reset the start time of a scroll-driven animation? == The WPT test [scroll-animations/scroll-timelines/play-animation.html](https://github.com/web-platform-tests/wpt/blob/master/scroll-animations/scroll-timelines/play-animation.html) has a "Playing a running animation resets a sticky start time" subtest that assumes that a running scroll-driven animation with an explicitly-set start time should reset its start time when `play()` is called: ```javascript promise_test(async t => { const animation = createScrollLinkedAnimation(t); animation.play(); await animation.ready; animation.currentTime = CSSNumericValue.parse("10%"); assert_percents_equal(animation.currentTime, 10); animation.play(); await animation.ready; assert_percents_equal(animation.currentTime, 0); }, 'Playing a running animation resets a sticky start time'); ``` From my reading of the spec, when `animation.currentTime` is explicitly set, the animation's _start time_ is resolved and the _hold time_ is unresolved. At this stage, both Chrome and WebKit agree that: - the animation is not pending, - the play state is "running", - the start time is `-10%`. So upon `animation.play()` being called, the [playing an animation](https://drafts.csswg.org/web-animations-2/#playing-an-animation-section) procedure is called with the _auto-rewind_ flag set to true. In step 3, _has finite timeline_ will be set to true since the animation is associated with a scroll timeline. This means that in step 5, _enable seek_ will be set to false. As a result, reading from the rest of the procedure, I don't see how either the animation hold time or start time is modified during this procedure and we abort the procedure in step 10. What this test is doing seems fine to me, but it seems the spec does not support it at the moment. Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11469 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 9 January 2025 17:36:45 UTC