[webkit-changes] [WebKit/WebKit] dd9fc6: [scroll-animations] address WPT failures related t...

Antoine Quint noreply at github.com
Sun Feb 9 23:51:30 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dd9fc65cb4bc5cd6455330e6ae0cca0d9cfe328d
      https://github.com/WebKit/WebKit/commit/dd9fc65cb4bc5cd6455330e6ae0cca0d9cfe328d
  Author: Antoine Quint <graouts at webkit.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-deferred-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-named-scroll-progress-timeline.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-none-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-dynamic.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/timeline-scope-expected.txt
    M Source/WebCore/animation/AnimationTimelinesController.cpp
    M Source/WebCore/animation/AnimationTimelinesController.h
    M Source/WebCore/animation/CSSAnimation.cpp

  Log Message:
  -----------
  [scroll-animations] address WPT failures related to `timeline-scope` and `animation-timeline`
https://bugs.webkit.org/show_bug.cgi?id=287337

Reviewed by Anne van Kesteren.

In 290046 at main we put together a sounder approach to attaching timelines to style-originated
animations by waiting until the style resolution process completed. But the attachment logic
as well as when to attempt attachment immediately or defer it was lacking and resulted in many
WPT failures related to the `timeline-scope` and `animation-timeline` properties.

We now add a parameter to `AnimationTimelinesController::setTimelineForName()` that determines
whether attachment deferral until style resolution has completed is allowed (ie. when we're
processing the `animation-timeline` property during style resolution) or to attempt attachment
immediately (ie. when style resolution has completed).

Then when we enter `setTimelineForName()`, we have three options:

1. If deferral is allowed and we don't have an active named timeline, wait until style resolution
has completed to see if a timeline exists then.

2. If deferral is not allowed and we still don't have an active named timeline, assign either a
placeholder inactive scroll timeline if the name is in scope, or a null timeline otherwise.

3. If we have an active named timeline, determine which one to use per `determineTimelineForElement()`.

Finally, when the `animation-timeline` property changes to a value that is not a timeline name – such
as `auto`, `none`, `scroll()` or `view()` – we remove all pending attachment operations for this CSS
Animation.

There remain a few WPT failures but these will be handled by future individual patches.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-deferred-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-named-scroll-progress-timeline.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-none-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-dynamic.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/timeline-scope-expected.txt:
* Source/WebCore/animation/AnimationTimelinesController.cpp:
(WebCore::AnimationTimelinesController::registerNamedScrollTimeline):
(WebCore::AnimationTimelinesController::removePendingOperationsForCSSAnimation):
(WebCore::AnimationTimelinesController::documentDidResolveStyle):
(WebCore::AnimationTimelinesController::unregisterNamedTimeline):
(WebCore::AnimationTimelinesController::setTimelineForName):
* Source/WebCore/animation/AnimationTimelinesController.h:
* Source/WebCore/animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncStyleOriginatedTimeline):

Canonical link: https://commits.webkit.org/290145@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list