Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c6928763a16810d8e4caf686044eab1b04627391
https://github.com/WebKit/WebKit/commit/c6928763a16810d8e4caf686044eab1b04627391
Author: Wenson Hsieh <[email protected]>
Date: 2025-05-07 (Wed, 07 May 2025)
Changed paths:
M Source/WebKit/UIProcess/PageClient.h
M Source/WebKit/UIProcess/mac/PageClientImplMac.h
M Source/WebKit/UIProcess/mac/PageClientImplMac.mm
M Source/WebKit/UIProcess/mac/WebViewImpl.h
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
Log Message:
-----------
[macOS] Content inset fill backdrop layer sometimes ends up on top of the
root layer
https://bugs.webkit.org/show_bug.cgi?id=292668
rdar://148840316
Reviewed by Abrar Rahman Protyasha and Richard Robinson.
Currently, the backdrop layer for the content inset fill view sometimes gets
unparented and
reinserted in the web view, from underneath WebKit (i.e. AppKit). This happens
because the `NSView`
corresponding to the backdrop layer is underneath the `WKWebView` right now,
but the backdrop layer
actually needs to be inserted before the `m_rootLayer`, under the
`WKFlippedView`'s layer. This
reinsertion happens in `updateContentInsetFillBackdropLayerParentIfNeeded()`,
and runs (only if
necessary) after each rendering update, which might've changed the compositing
layer hierarchy.
This mostly works, but there are still cases where AppKit ends up switching the
sublayer hierarchy
out from under us (for example, when hovering over items in the sidebar). To
mitigate this, we
change up our approach entirely, by:
1. Inserting the backdrop layer's view under `WKFlippedView` (such that the
backdrop layer parent
is consistent with its view's parent in the view hierarchy).
2. Setting a large negative `zPosition` on the backdrop layer instead, to
force the layer to be
beneath `m_rootLayer` in compositing order (even if it's in front of it in
sublayer order).
This alternative approach avoids the need for shuffling around any layers, and
ensures that the
view hierarchy is consistent with the backing layer hierarchy.
* Source/WebKit/UIProcess/PageClient.h:
(WebKit::PageClient::layerTreeCommitComplete):
* Source/WebKit/UIProcess/mac/PageClientImplMac.h:
* Source/WebKit/UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::layerTreeCommitComplete): Deleted.
Delete this now-unused codepath.
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::layerTreeCommitComplete): Deleted.
Canonical link: https://commits.webkit.org/294632@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes