Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 42cf0519aef9309ac80daefc2f6b30d9af0e3308
https://github.com/WebKit/WebKit/commit/42cf0519aef9309ac80daefc2f6b30d9af0e3308
Author: Etienne Segonzac <[email protected]>
Date: 2025-12-04 (Thu, 04 Dec 2025)
Changed paths:
R LayoutTests/overlay-region/big-edge-overlay-expected.txt
R LayoutTests/overlay-region/big-edge-overlay-horizontal-expected.txt
R LayoutTests/overlay-region/big-edge-overlay-horizontal.html
R LayoutTests/overlay-region/big-edge-overlay.html
M LayoutTests/overlay-region/full-page-dynamic-expected.txt
M LayoutTests/overlay-region/full-page-expected.txt
M LayoutTests/overlay-region/full-page-overflow-expected.txt
M LayoutTests/overlay-region/full-page-overflow-scrolling-expected.txt
M LayoutTests/overlay-region/full-page-scrolling-expected.txt
R LayoutTests/overlay-region/merging-expected.txt
R LayoutTests/overlay-region/merging.html
M LayoutTests/overlay-region/overlay-background-expected.txt
R LayoutTests/overlay-region/snapping-expected.txt
R LayoutTests/overlay-region/snapping.html
M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h
M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h
M
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.h
M
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm
M Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
M Source/WebKit/UIProcess/ios/WKScrollView.mm
Log Message:
-----------
[visionOS] Update OverlayRegion configuration more deliberately
https://bugs.webkit.org/show_bug.cgi?id=303394
<rdar://163802576>
Reviewed by Mike Wyrzykowski.
This patch re-organizes the Overlay Region management code, both for
performance reasons and in preparation of further changes.
It also moves the code from WKWebViewIOS to
RemoteScrollingCoordinatorProxyIOS.
First, we remove the code responsible for snapping, merging and
filtering Overlay Region rects. The system consuming these rects
already implements the same logic.
The ScrollView selection for Overlay Regions now only runs when a
ScrollingNode is added, removed or when relevant properties like the
TotalContentsSize change.
Finally, the tree traversal to find Overlay Region rects is also
optimized to stop early and limit the amount walking up the ancestor
chain.
Tests: updated the expectation files after disabling snapping, merging
and filtering from the old code. Confirmed that the changes on top of
that do not change the expectations.
* LayoutTests/overlay-region/big-edge-overlay-expected.txt: Removed.
* LayoutTests/overlay-region/big-edge-overlay-horizontal-expected.txt: Removed.
* LayoutTests/overlay-region/big-edge-overlay-horizontal.html: Removed.
* LayoutTests/overlay-region/big-edge-overlay.html: Removed.
* LayoutTests/overlay-region/snapping-expected.txt: Removed.
* LayoutTests/overlay-region/snapping.html: Removed.
* LayoutTests/overlay-region/merging-expected.txt: Removed.
* LayoutTests/overlay-region/merging.html: Removed.
Remove tests that are no longer relevant.
* LayoutTests/overlay-region/full-page-dynamic-expected.txt:
* LayoutTests/overlay-region/full-page-expected.txt:
* LayoutTests/overlay-region/full-page-overflow-expected.txt:
* LayoutTests/overlay-region/full-page-overflow-scrolling-expected.txt:
* LayoutTests/overlay-region/full-page-scrolling-expected.txt:
* LayoutTests/overlay-region/overlay-background-expected.txt:
Update expectations with snapping, merging and filtering off.
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _didCommitLayerTree:mainFrameData:pageData:transactionID:]):
(addOverlayEventRegions): Deleted.
(snapRectToScrollViewEdges): Deleted.
(configureScrollViewWithOverlayRegionsIDs): Deleted.
(-[WKWebView _scrollViewCanHaveOverlayRegions:]): Deleted.
(-[WKWebView _selectOverlayRegionScrollView:]): Deleted.
(-[WKWebView _updateOverlayRegions]): Deleted.
(-[WKWebView _resetOverlayRegions]): Deleted.
(-[WKWebView _updateScrollCoordinatorProxyForOverlayRegions:]): Deleted.
Remove the code from WKWebViewIOS.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTreeTransaction):
Update Overlay Regions as part of the layer tree transaction commit.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
(WebKit::RemoteScrollingCoordinatorProxy::updateOverlayRegions):
(WebKit::RemoteScrollingCoordinatorProxy::overlayRegionsEnabledChanged):
*
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.h:
*
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxyIOS::updateOverlayRegions):
(WebKit::RemoteScrollingCoordinatorProxyIOS::overlayRegionsEnabledChanged):
(WebKit::RemoteScrollingCoordinatorProxyIOS::selectOverlayRegionScrollViewIfNeeded):
(WebKit::overlayDrawsAboveScrollView):
(WebKit::RemoteScrollingCoordinatorProxyIOS::updateOverlayRegionLayers):
(WebKit::RemoteScrollingCoordinatorProxyIOS::connectStateNodeLayers):
(WebKit::RemoteScrollingCoordinatorProxyIOS::establishLayerTreeScrollingRelations):
(WebKit::RemoteScrollingCoordinatorProxyIOS::removeDestroyedLayerIDs): Deleted.
(WebKit::RemoteScrollingCoordinatorProxyIOS::fixedScrollingNodeLayerIDs const):
Deleted.
(WebKit::RemoteScrollingCoordinatorProxyIOS::overlayRegionCandidates const):
Deleted.
Add the improved logic back to the RemoteScrollingCoordinatorProxyIOS.
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::preferencesDidChange):
Signal the ScrollingCoordinator, and not the WebView, when the
preference changes.
* Source/WebKit/UIProcess/ios/WKScrollView.mm:
(-[WKScrollView setScrollEnabled:]):
(-[WKScrollView _setScrollEnabledInternal:]):
Avoid calling `_updateScrollability` when the value doesn't change since
it triggers non-trivial work downstream for Overlay Regions.
Canonical link: https://commits.webkit.org/303903@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications