Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 230a3fd2ec731e03af1199f9fdb712c603de333f
      
https://github.com/WebKit/WebKit/commit/230a3fd2ec731e03af1199f9fdb712c603de333f
  Author: Antoine Quint <[email protected]>
  Date:   2025-12-17 (Wed, 17 Dec 2025)

  Changed paths:
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationStack.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationStack.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationTimeline.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteMonotonicTimeline.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteProgressBasedTimeline.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/RemoteProgressBasedTimelineRegistry.cpp
    M 
Source/WebKit/UIProcess/RemoteLayerTree/RemoteProgressBasedTimelineRegistry.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeDrawingAreaProxyIOS.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeDrawingAreaProxyIOS.mm
    M 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm

  Log Message:
  -----------
  [threaded-animations] scroll-driven animations don't update in sync with 
scroll updates on iOS
https://bugs.webkit.org/show_bug.cgi?id=304189
rdar://166546662

Reviewed by Anne van Kesteren.

On iOS, we would update all threaded animations, scroll-driven as well as 
time-based, as the
display refreshes. However, scroll-driven animations should be updated as the 
remote scrolling
three updates, and time-based animations should be updated as the display is 
updated.

We already update progress-based timelines correctly as the remote scrolling 
tree updates,
in `RemoteScrollingTreeIOS::scrollingTreeNodeDidScroll()`. That method already 
call
`RemoteScrollingCoordinatorProxyIOS::progressBasedTimelinesWereUpdatedForNode()`,
 so now
instead of scheduling a display refresh callback we call the new method
`updateAnimationStacksDependentOnScrollingNode()` such that all animations 
stacks that
have animations associated with a timeline that as that scrolling node as its 
source
get updated.

We also introduce a new `updateTimeDependentAnimationStacks()` method which 
only updates
animation stacks that contain animations associated with a monotonic timeline, 
and only
call this method under `displayDidRefresh()`.

Finally, we must make sure to only schedule display refresh callbacks for 
monotonic animations,
so we rename the various methods on `RemoteLayerTreeDrawingAreaProxyIOS` that 
are related
scheduling such updates to make it clear they're only relevant to monotonic 
animations, and then
we only call them in situations where we have animations stacks containing 
monotonic animations.

As a result, we update progress-based timelines and any animation stack 
containing an associated
scroll-driven animation as a remote scrolling tree node is updated, and we 
schedule display refresh
callbacks for animations only if we have monotonic animations, only updating 
animation stacks
containing such animations as those callbacks fire.

As a result we can remove `RemoteScrollingTree::hasTimelineForNode()` and the 
methods under it
since it is now unused.

* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationStack.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationStack.mm:
(WebKit::RemoteAnimationStack::isDependentOnScrollingNodeWithID const):
(WebKit::RemoteAnimationStack::isTimeDependent const):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationTimeline.h:
(WebKit::RemoteAnimationTimeline::isMonotonic const):
(WebKit::RemoteAnimationTimeline::isProgressBased const):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteMonotonicTimeline.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteProgressBasedTimeline.h:
* 
Source/WebKit/UIProcess/RemoteLayerTree/RemoteProgressBasedTimelineRegistry.cpp:
(WebKit::RemoteProgressBasedTimelineRegistry::hasTimelineForNode const): 
Deleted.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteProgressBasedTimelineRegistry.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::hasTimelineForNode const): Deleted.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeDrawingAreaProxyIOS.h:
* 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeDrawingAreaProxyIOS.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::pauseDisplayRefreshCallbacks):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::scheduleDisplayRefreshCallbacksForMonotonicAnimations):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::pauseDisplayRefreshCallbacksForMonotonicAnimations):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::scheduleDisplayRefreshCallbacksForAnimation):
 Deleted.
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::pauseDisplayRefreshCallbacksForAnimation):
 Deleted.
* 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.h:
* 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxyIOS::displayDidRefresh):
(WebKit::RemoteScrollingCoordinatorProxyIOS::animationsWereAddedToNode):
(WebKit::RemoteScrollingCoordinatorProxyIOS::progressBasedTimelinesWereUpdatedForNode):
(WebKit::RemoteScrollingCoordinatorProxyIOS::animationsWereRemovedFromNode):
(WebKit::RemoteScrollingCoordinatorProxyIOS::updateTimeDependentAnimationStacks):
(WebKit::RemoteScrollingCoordinatorProxyIOS::updateAnimationStacksDependentOnScrollingNode):
(WebKit::RemoteScrollingCoordinatorProxyIOS::updateAnimationStacks):
(WebKit::RemoteScrollingCoordinatorProxyIOS::updateAnimations): Deleted.

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



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

Reply via email to