Skip to content

Conversation

@etiennesegonzac
Copy link
Contributor

@etiennesegonzac etiennesegonzac commented Nov 8, 2024

d634b45

Separated layers should support `border-radius`
https://bugs.webkit.org/show_bug.cgi?id=282834
<rdar://137275518>

Reviewed by Simon Fraser.

When using separated layers, we need to apply the corner radius to the
main layer if at all possible in order to get the expected visual effect.
Introduce a new clipping strategy for these layers.

* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Enable composited descendant clipping on separated layers.
(WebCore::RenderLayerBacking::updateContentsRects):
Generate a content clipping rect for all separated layers.

* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateClippingStrategy):
Set the corner radius on the main layer for separated layers. We also
relax the application to even corners (as opposed to uniform) since
masking won't yield the expected effect.

* Source/WebCore/rendering/RenderLayerCompositor.h:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::isSeparated):
Add a helper method to test if a RenderObject requires a separated
layer.

* LayoutTests/platform/visionos/transforms/separated-expected.txt:
* LayoutTests/platform/visionos/transforms/separated.html:
Update the test to cover this by adding a `border-radius` to the
transformed elements.

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

ef9be1c

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
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@etiennesegonzac etiennesegonzac self-assigned this Nov 8, 2024
@etiennesegonzac etiennesegonzac added the Layout and Rendering For bugs with layout and rendering of Web pages. label Nov 8, 2024
@etiennesegonzac etiennesegonzac requested a review from smfr November 8, 2024 16:03
@etiennesegonzac etiennesegonzac added the merge-queue Applied to send a pull request to merge-queue label Nov 9, 2024
https://bugs.webkit.org/show_bug.cgi?id=282834
<rdar://137275518>

Reviewed by Simon Fraser.

When using separated layers, we need to apply the corner radius to the
main layer if at all possible in order to get the expected visual effect.
Introduce a new clipping strategy for these layers.

* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Enable composited descendant clipping on separated layers.
(WebCore::RenderLayerBacking::updateContentsRects):
Generate a content clipping rect for all separated layers.

* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateClippingStrategy):
Set the corner radius on the main layer for separated layers. We also
relax the application to even corners (as opposed to uniform) since
masking won't yield the expected effect.

* Source/WebCore/rendering/RenderLayerCompositor.h:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::isSeparated):
Add a helper method to test if a RenderObject requires a separated
layer.

* LayoutTests/platform/visionos/transforms/separated-expected.txt:
* LayoutTests/platform/visionos/transforms/separated.html:
Update the test to cover this by adding a `border-radius` to the
transformed elements.

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

Committed 286384@main (d634b45): https://commits.webkit.org/286384@main

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

@webkit-commit-queue webkit-commit-queue merged commit d634b45 into WebKit:main Nov 9, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Layout and Rendering For bugs with layout and rendering of Web pages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants