[webkit-changes] [WebKit/WebKit] 897d1c: [scroll-animations] "Removing/inserting element wi...

Antoine Quint noreply at github.com
Thu Feb 13 03:59:55 PST 2025


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

  Changed paths:
    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/style/Styleable.cpp

  Log Message:
  -----------
  [scroll-animations] "Removing/inserting element with attaching timeline" WPT test is failing
https://bugs.webkit.org/show_bug.cgi?id=287561

Reviewed by Dean Jackson.

When an element is disconnected from the document, we must make sure that any style-originated
timeline that was created due to a `scroll-timeline-name` or `view-timeline-name` property set
on that element is unregistered and that animations associated with that timeline are re-evaluated.

Currently, the method `AnimationTimelinesController::unregisterNamedTimelinesAssociatedWithElement()`
is already called when an element is disconnected from the document by virtue of the render tree
teardown calling into `Styleable::cancelStyleOriginatedAnimations()`. But that method simply removes
the timelines originated from that element from the name-to-timeline map.

We need to also ensure that the associated animations are re-evaluated, so we add a new method
`AnimationTimelinesController::styleableWasRemoved()` called when an element is removed, via
`Styleable::elementWasRemoved()`, and make sure to update the animations associated with the
affected timeline's name. To that end, we collect the removed timelines in a new `m_removedTimelines`
set so that we may process the timelines removed in `unregisterNamedTimelinesAssociatedWithElement()`
once the element is removed from the DOM (since `unregisterNamedTimelinesAssociatedWithElement()`
is called first).

* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/timeline-scope-expected.txt:
* Source/WebCore/animation/AnimationTimelinesController.cpp:
(WebCore::AnimationTimelinesController::documentDidResolveStyle):
(WebCore::AnimationTimelinesController::unregisterNamedTimelinesAssociatedWithElement):
(WebCore::AnimationTimelinesController::styleableWasRemoved):
* Source/WebCore/animation/AnimationTimelinesController.h:
* Source/WebCore/style/Styleable.cpp:
(WebCore::Styleable::elementWasRemoved const):

Canonical link: https://commits.webkit.org/290337@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