Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: de8c3e0c5b1569b54b671df962fb811deda134b8
https://github.com/WebKit/WebKit/commit/de8c3e0c5b1569b54b671df962fb811deda134b8
Author: Antoine Quint <[email protected]>
Date: 2026-02-11 (Wed, 11 Feb 2026)
Changed paths:
M LayoutTests/platform/mac-wk2/TestExpectations
M LayoutTests/resources/ui-helper.js
A
LayoutTests/webanimations/threaded-animations/ios/display-link-opts-into-high-frame-rate-with-high-impact-animations-expected.txt
A
LayoutTests/webanimations/threaded-animations/ios/display-link-opts-into-high-frame-rate-with-high-impact-animations.html
M Source/WebCore/platform/animation/AcceleratedEffect.cpp
M Source/WebCore/platform/animation/AcceleratedEffect.h
M Source/WebCore/platform/graphics/GraphicsLayer.h
M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
M
Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.cpp
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.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
M Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
M Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h
M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm
Log Message:
-----------
[threaded-animations] only opt animations affecting transform into high frame
rate on iOS
https://bugs.webkit.org/show_bug.cgi?id=307554
rdar://problem/170153252
Reviewed by Simon Fraser.
In 307177@main we added a dedicated setting to control whether high frame rate
can be used to update animations at all.
But even if this setting is enabled, we need to be smart about what animations
will be updated at a high frame rate.
An obvious first step is to only include animations targeting a
transform-related property.
To support this, we add a new `AcceleratedEffect::hasHighImpact()` method which
we'll use on the remote side to keep
a per-node flag as `RemoteLayerTreeNode::m_hasHighImpactMonotonicAnimations`
that we update when a node's animation
stack is updated from the web side (ie. as animations start and end).
Then `RemoteScrollingCoordinatorProxyIOS`, which is notified as animations are
added and removed, can notify
`RemoteLayerTreeDrawingAreaProxyIOS` of such updates such that its new
`m_hasHighImpactMonotonicAnimations`
flag can be updated.
Finally, we account for this flag in
`RemoteLayerTreeDrawingAreaProxyIOS::scheduleDisplayLinkAndSetFrameRate()`
to determine whether to request high frame rate updates for the display link.
In order to test this, we add a new bit indicating whether an accelerated
effect has high impact on the web side
when calling `internals.acceleratedAnimationsForElement()`, as well as a new
`UIScriptController.displayLinkWantsHighFrameRate()`
method to indicate whether the display link has been asked to update at a high
frame rate. Combining those two
testing abilities, we write a new test that checks that animations marked as
high impact indeed end up causing
the display link to request high frame rate updates.
Test:
webanimations/threaded-animations/ios/display-link-opts-into-high-frame-rate-with-high-impact-animations.html
* LayoutTests/platform/mac-wk2/TestExpectations:
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.async displayLinkWantsHighFrameRate):
*
LayoutTests/webanimations/threaded-animations/ios/display-link-opts-into-high-frame-rate-with-high-impact-animations-expected.txt:
Added.
*
LayoutTests/webanimations/threaded-animations/ios/display-link-opts-into-high-frame-rate-with-high-impact-animations.html:
Added.
* Source/WebCore/platform/animation/AcceleratedEffect.cpp:
(WebCore::AcceleratedEffect::hasHighImpact const):
* Source/WebCore/platform/animation/AcceleratedEffect.h:
* Source/WebCore/platform/graphics/GraphicsLayer.h:
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
*
Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.cpp:
(WebCore::GraphicsLayerCoordinated::acceleratedAnimationsForTesting const):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::acceleratedAnimationsForElement):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _displayLinkWantsHighFrameRate]):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
(WebKit::RemoteLayerTreeDrawingAreaProxy::displayLinkWantsHighFrameRateForTesting
const):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::setAcceleratedEffectsAndBaseValues):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
(WebKit::RemoteScrollingCoordinatorProxy::hasHighImpactMonotonicAnimations
const):
*
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeDrawingAreaProxyIOS.h:
*
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeDrawingAreaProxyIOS.mm:
(-[WKDisplayLinkHandler wantsHighFrameRate]):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::scheduleDisplayRefreshCallbacksForMonotonicAnimations):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::highImpactMonotonicAnimationsWereRemoved):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::pauseDisplayRefreshCallbacksForMonotonicAnimations):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::scheduleDisplayLinkAndSetFrameRate):
(WebKit::RemoteLayerTreeDrawingAreaProxyIOS::displayLinkWantsHighFrameRateForTesting
const):
*
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.h:
*
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxyIOS::animationsWereRemovedFromNode):
(WebKit::RemoteScrollingCoordinatorProxyIOS::hasHighImpactMonotonicAnimations
const):
* Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::displayLinkWantsHighFrameRate const):
* Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h:
* Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm:
(WTR::UIScriptControllerCocoa::displayLinkWantsHighFrameRate const):
Canonical link: https://commits.webkit.org/307339@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications