Skip to content

[Liquid Glass] [macOS] Top overhang color extension layer is clipped when rubber-banding against the top of the page while zoomed in #47273

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
merged 1 commit into from
Jun 27, 2025

Conversation

whsieh
Copy link
Member

@whsieh whsieh commented Jun 27, 2025

6cc2003

[Liquid Glass] [macOS] Top overhang color extension layer is clipped when rubber-banding against the top of the page while zoomed in
https://bugs.webkit.org/show_bug.cgi?id=295077
Followup to rdar://151482288

Reviewed by Abrar Rahman Protyasha.

Small followup fix after the changes in 296667@main — the new top overhang color extension layer
should have been positioned right above the root content layer; the width should match that of the
root content layer (`frameView`'s `contentsSize`), and the bottom edge should meet the root content
layer's top edge.

In particular, the existing logic (without this adjustment) causes the width of the color extension
layer to be shorter than required to span the full content width, when pinch-zooming into the web
view and scrolling against the top right edge of the screen.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::setContentsSize):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):

Move the call to `updateSizeAndPositionForTopOverhangColorExtensionLayer` into
`updateRootLayerPosition`, after the existing calls to update overhang layers.

(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::updateSizeAndPositionForTopOverhangColorExtensionLayer):

See above. Note that the height of this color extension layer shouldn't really matter in practice —
as long as it's tall enough that it covers at least any vertical distance when rubber-banding. I
arbitrarily chose the visible height of the frame view here, assuming that users wouldn't need to
rubber-band the page so far, such that the page is not even visible.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/ObscuredContentInsets.mm:
(TestWebKitAPI::TEST(ObscuredContentInsets, TopOverhangColorExtensionLayer)):

Augment this API test to additionally sanity check the frame and background of the color extension
layer, both before and after zooming in. In both cases, the width should be consistent with the root
content layer, and it should be positioned such that the bottom of the layer is aligned to the top
of the root content layer.

Canonical link: https://commits.webkit.org/296704@main

2ba6900

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@whsieh whsieh requested a review from cdumez as a code owner June 27, 2025 00:51
@whsieh whsieh self-assigned this Jun 27, 2025
@whsieh whsieh added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Jun 27, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 27, 2025
@whsieh whsieh removed the merging-blocked Applied to prevent a change from being merged label Jun 27, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 27, 2025
@whsieh whsieh removed the merging-blocked Applied to prevent a change from being merged label Jun 27, 2025
@whsieh whsieh added the merge-queue Applied to send a pull request to merge-queue label Jun 27, 2025
…when rubber-banding against the top of the page while zoomed in

https://bugs.webkit.org/show_bug.cgi?id=295077
Followup to rdar://151482288

Reviewed by Abrar Rahman Protyasha.

Small followup fix after the changes in 296667@main — the new top overhang color extension layer
should have been positioned right above the root content layer; the width should match that of the
root content layer (`frameView`'s `contentsSize`), and the bottom edge should meet the root content
layer's top edge.

In particular, the existing logic (without this adjustment) causes the width of the color extension
layer to be shorter than required to span the full content width, when pinch-zooming into the web
view and scrolling against the top right edge of the screen.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::setContentsSize):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):

Move the call to `updateSizeAndPositionForTopOverhangColorExtensionLayer` into
`updateRootLayerPosition`, after the existing calls to update overhang layers.

(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::updateSizeAndPositionForTopOverhangColorExtensionLayer):

See above. Note that the height of this color extension layer shouldn't really matter in practice —
as long as it's tall enough that it covers at least any vertical distance when rubber-banding. I
arbitrarily chose the visible height of the frame view here, assuming that users wouldn't need to
rubber-band the page so far, such that the page is not even visible.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/ObscuredContentInsets.mm:
(TestWebKitAPI::TEST(ObscuredContentInsets, TopOverhangColorExtensionLayer)):

Augment this API test to additionally sanity check the frame and background of the color extension
layer, both before and after zooming in. In both cases, the width should be consistent with the root
content layer, and it should be positioned such that the bottom of the layer is aligned to the top
of the root content layer.

Canonical link: https://commits.webkit.org/296704@main
@webkit-commit-queue
Copy link
Collaborator

Committed 296704@main (6cc2003): https://commits.webkit.org/296704@main

Reviewed commits have been landed. Closing PR #47273 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 6cc2003 into WebKit:main Jun 27, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 27, 2025
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants