Skip to content
Permalink
Browse files
Overlay regions sometimes get stuck in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=247623
<rdar://102063820>

Reviewed by Tim Horton.

Scrolling layers can change positions even when none are destroyed or changed.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _updateOverlayRegions:destroyedLayers:]):

Canonical link: https://commits.webkit.org/256504@main
  • Loading branch information
mwyrzykowski committed Nov 9, 2022
1 parent 397e7c4 commit 3f60b4cf94f348329bf410ceb0aea64e24cf7c28
Showing 1 changed file with 5 additions and 4 deletions.
@@ -1087,8 +1087,7 @@ static void addOverlayEventRegions(WebCore::GraphicsLayer::PlatformLayerID layer

- (void)_updateOverlayRegions:(const WebKit::RemoteLayerTreeTransaction::LayerPropertiesMap&)changedLayerPropertiesMap destroyedLayers:(const Vector<WebCore::GraphicsLayer::PlatformLayerID>&)destroyedLayers
{
if (!changedLayerPropertiesMap.size() && !destroyedLayers.size())
return;
BOOL skipRecursiveRegionUpdate = !changedLayerPropertiesMap.size() && !destroyedLayers.size();

auto& layerTreeProxy = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea());
auto& layerTreeHost = layerTreeProxy.remoteLayerTreeHost();
@@ -1103,8 +1102,10 @@ - (void)_updateOverlayRegions:(const WebKit::RemoteLayerTreeTransaction::LayerPr
for (auto layerID : destroyedLayers)
overlayRegionIDs.remove(layerID);

for (auto layerID : fixedIDs)
addOverlayEventRegions(layerID, changedLayerPropertiesMap, overlayRegionIDs, layerTreeHost);
if (!skipRecursiveRegionUpdate) {
for (auto layerID : fixedIDs)
addOverlayEventRegions(layerID, changedLayerPropertiesMap, overlayRegionIDs, layerTreeHost);
}

Vector<CGRect> overlayRegions;
for (const auto layerID : overlayRegionIDs) {

0 comments on commit 3f60b4c

Please sign in to comment.