-
Notifications
You must be signed in to change notification settings - Fork 693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[web-animations-2] moving from a progress-based timeline to a monotonic timeline can yield incompatible timeline time and animation current time #11761
Labels
Comments
graouts
added a commit
to graouts/WebKit
that referenced
this issue
Feb 21, 2025
…l-animation-effect-phases.tentative.html has failures https://bugs.webkit.org/show_bug.cgi?id=284545 rdar://problem/141356963 Reviewed by NOBODY (OOPS!). The technique used by this test to determine the phase [0] in which an animation is, which is not explicitly exposed via the Web Animations API, was not up-to-date with the fact that progress-based animations remain active at the 100% boundary. So we update the supporting `assert_phase()` function to deal with such animations and pass the previously failing assertion. But going further into this test, we would hit a debug assertion when trying to compute the unconstrained current time as we get to the end of the procedure to set the timeline as we move from the scroll timeline to the document timeline. I filed a spec issue [1] to deal with this and came up with a temporary fix to restore the timing incompatibility and pass this test. [0] https://drafts.csswg.org/web-animations-1/#animation-effect-phases-and-states [1] w3c/csswg-drafts#11761 * LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/scroll-animation-effect-phases.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/web-animations/testcommon.js: (assert_phase): * Source/WebCore/animation/WebAnimation.cpp: (WebCore::WebAnimation::setTimeline):
The purpose of step 9 in setting the timeline is to continue the animation from its previous progress on the new timeline. It seems that we didn't expect to have both start time and hold time set. Given the animation is holding in a finished state I guess we should make the start time unresolved in this case? |
webkit-commit-queue
pushed a commit
to graouts/WebKit
that referenced
this issue
Feb 21, 2025
…l-animation-effect-phases.tentative.html has failures https://bugs.webkit.org/show_bug.cgi?id=284545 rdar://problem/141356963 Reviewed by Anne van Kesteren. The technique used by this test to determine the phase [0] in which an animation is, which is not explicitly exposed via the Web Animations API, was not up-to-date with the fact that progress-based animations remain active at the 100% boundary. So we update the supporting `assert_phase()` function to deal with such animations and pass the previously failing assertion. But going further into this test, we would hit a debug assertion when trying to compute the unconstrained current time as we get to the end of the procedure to set the timeline as we move from the scroll timeline to the document timeline. I filed a spec issue [1] to deal with this and came up with a temporary fix to restore the timing incompatibility and pass this test. [0] https://drafts.csswg.org/web-animations-1/#animation-effect-phases-and-states [1] w3c/csswg-drafts#11761 * LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/scroll-animation-effect-phases.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/web-animations/testcommon.js: (assert_phase): * Source/WebCore/animation/WebAnimation.cpp: (WebCore::WebAnimation::setTimeline): Canonical link: https://commits.webkit.org/290787@main
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm working on a failure in the WPT subtest "Playback rate affects whether active phase boundary is inclusive" in
scroll-animations/scroll-timelines/scroll-animation-effect-phases.tentative.html
and encountered what appears to be a spec issue. I've simplified the test in this particular reduction:In WebKit – at the time of writing (290776@main) – this particular test yields a debug assertion because we end up attempting an operation with a time value that is expressed in seconds and one expressed as a percentage. Here's how we get there, and I believe in accordance with the current specifications:
Step 1
Under the call to
Element.animate()
, the procedure to set the timeline of an animation takes us inside the "if to finite timeline" branch and we set both the start time and the hold time to be unresolved.Step 2
As the update animations and send events procedure is triggered and the animation becomes ready, we calculate an auto-aligned start time and set the start time to
0%
as the hold time remains unresolved.Step 3
After the animation timeline's source changes scroll position, and during the next occurence of the update animations and send events procedure, we update the animation's finished state and match this condition:
… and then match this condition:
… and finally this sub-condition:
As a result, the hold time is set to
100%
and the start time remains set to0%
.Step 4
As we set the timeline to the document timeline, and as such move from a progress-based timeline to a monotonic timeline, we enter this condition:
As such we immediately run the procedure to silently set the current time and enter this condition:
As a result, the hold time becomes
0s
and the start time remains0%
. Note that these two times are now using different time units.As the setting the timeline procedure continues, we additionally run this step:
As a result, the hold time becomes unresolved and the start time remains
0%
.To finish setting the timeline we update the animation's finished state and attempt to compute the unconstrained current time at which point we attempt to compute:
The timeline time is a resolved time expressed in seconds since the timeline is monotonic while the start time has remained
0%
. This is when WebKit hits a debug assertion.The WPT in question test immediately sets the current time to
0
but I don't think we should be in the situation described above as we set the timeline.The text was updated successfully, but these errors were encountered: