Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f34545487d2f0ae366253ef8daab7088a3e830fc
      
https://github.com/WebKit/WebKit/commit/f34545487d2f0ae366253ef8daab7088a3e830fc
  Author: Antoine Quint <[email protected]>
  Date:   2026-05-20 (Wed, 20 May 2026)

  Changed paths:
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationStack.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationStack.mm
    M 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm
    M 
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.mm

  Log Message:
  -----------
  [threaded-animations] stuttery animation on bmwusa.com configurator page with 
60Hz display
https://bugs.webkit.org/show_bug.cgi?id=315209
rdar://176420489

Reviewed by Simon Fraser.

On macOS, an animation update is triggered both when a display refresh occurs 
on the
scrolling thread, somewhere under 
`RemoteLayerTreeEventDispatcher::didRefreshDisplay()`,
and when a page rendering update has completed on the main thread, in
`RemoteLayerTreeEventDispatcher::renderingUpdateComplete()`.

The latter call was added in 303810@main to ensure that programmatic scrolls 
would
correctly update progress-based animations. However, this has the undesired 
effects
that when the page rendering is updated, all animations, including those 
contained
in animation stacks that only contain time-based animations, are updated twice.

In the case of a Pro Motion display, typically this would mean that we update 
animations
twice every other frame, since page rendering updates still occur near 60Hz by 
default.
But on a display set to refresh at 60Hz, the issue is made worse since we end up
updating animations twice on every frame.

To address this, at least for the case where only time-based animations are 
used (the
vast majority of cases at this currently), we no longer update animation stacks 
that
only contain time-based animations when 
`RemoteLayerTreeEventDispatcher::renderingUpdateComplete()`
is called. We do so by adding a new enum argument to `updateAnimations()` and 
only
advance monotonic timelines and update animation stacks containing time-based 
animations
if the argument indicates that all animation stacks should be updated, as 
opposed to those
containing at least one progress-based animation.

* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationStack.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimationStack.mm:
(WebKit::RemoteAnimationStack::RemoteAnimationStack):
(WebKit::RemoteAnimationStack::isTimeDependent const): Deleted.
* 
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxyIOS::updateTimeDependentAnimationStacks):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.mm:
(WebKit::RemoteLayerTreeEventDispatcher::renderingUpdateComplete):
(WebKit::RemoteLayerTreeEventDispatcher::updateAnimations):

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



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

Reply via email to