-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Liquid Glass] [macOS] Blank gap above top fixed header when rubber-banding against top of page #47215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+126
−25
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EWS run on previous version of this PR (hash 12bfcde) |
pxlcoder
approved these changes
Jun 26, 2025
aprotyas
reviewed
Jun 26, 2025
aprotyas
approved these changes
Jun 26, 2025
EWS run on current version of this PR (hash 6073282) |
Thanks for the reviews! |
…anding against top of page https://bugs.webkit.org/show_bug.cgi?id=295001 rdar://151482288 Reviewed by Abrar Rahman Protyasha and Aditya Keerthi. Currently, when rubber-banding against the top of a webpage in Safari with a fixed element near the top of the viewport, the page background color shows up in the gap between the bottom of the color extension view and the top edge of the fixed element. To fill in this gap, we introduce a new `m_layerForTopOverhangColorExtension` whose background color is updated to match the predominant sampled color of the fixed element near the top. We then place this new layer above the existing overhang layer for the page's extended background color. The layer becomes visible when rubber-banding past the top of the page. * Source/WebCore/page/LocalFrameView.cpp: (WebCore::LocalFrameView::setWantsLayerForTopOverhangColorExtension const): Add a new helper method to create and install `m_layerForTopOverhangColorExtension` in the `GraphicsLayer` hierarchy. This layer is inserted right before the existing `m_layerForTopOverhangArea` (which has now been renamed to avoid confusion). (WebCore::LocalFrameView::setWantsLayerForTopOverhangImage const): (WebCore::LocalFrameView::setWantsLayerForTopOverHangArea const): Deleted. Rename the existing `m_layerForTopOverhangArea` to `m_layerForTopOverhangImage`, to clarify that it's only used to contain the image supplied by the injected bundle client via the SPI function `WKBundlePageSetTopOverhangImage`. Note that this is only used by Safari's continuous reader mode. This renaming is important to disambiguate it from this new `m_layerForTopOverhangColorExtension`, which also sits inside the overhang area. * Source/WebCore/page/LocalFrameView.h: * Source/WebCore/page/Page.cpp: (WebCore::Page::updateFixedContainerEdges): Add or remove `m_layerForTopOverhangColorExtension` as needed (i.e., when there's a predominant sampled color). * Source/WebCore/rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::~RenderLayerCompositor): (WebCore::RenderLayerCompositor::frameViewDidChangeSize): Update the `m_layerForTopOverhangColorExtension`'s bounds, alongside the existing `m_layerForOverhangAreas`. (WebCore::RenderLayerCompositor::updateRootLayerPosition): (WebCore::RenderLayerCompositor::updateLayerForTopOverhangImage): (WebCore::RenderLayerCompositor::updateLayerForTopOverhangColorExtension): Add logic to add or remove `m_layerForTopOverhangColorExtension` — note that this new layer is inserted under `m_scrolledContentsLayer` (matching `m_layerForTopOverhangImage`), but goes beneath `m_layerForTopOverhangImage` in sublayer order if that already exists. (WebCore::RenderLayerCompositor::updateSizeAndPositionForOverhangAreaLayer): (WebCore::RenderLayerCompositor::updateSizeAndPositionForTopOverhangColorExtensionLayer): (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea): Deleted. * Source/WebCore/rendering/RenderLayerCompositor.h: * Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::setTopOverhangImage): * Tools/TestWebKitAPI/Tests/WebKitCocoa/ObscuredContentInsets.mm: (TestWebKitAPI::TEST(ObscuredContentInsets, TopOverhangColorExtensionLayer)): Add an API test that searches the layer hierarchy for this new `CALayer` (by name) and sanity checks its bounds, position, and background color. * Tools/TestWebKitAPI/cocoa/TestWKWebView.h: * Tools/TestWebKitAPI/cocoa/TestWKWebView.mm: (forEachCALayer): (-[WKWebView forEachCALayer:]): Canonical link: https://commits.webkit.org/296667@main
6073282
to
ddea071
Compare
Committed 296667@main (ddea071): https://commits.webkit.org/296667@main Reviewed commits have been landed. Closing PR #47215 and removing active labels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
New Bugs
Unclassified bugs are placed in this component until the correct component can be determined.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ddea071
6073282