Skip to content

corner-shape: non-round corner shapes are ignored for composited content (<video>, images, composited descendants) - #71079

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
cupidsity:video-corner-shape
Aug 16, 2026
Merged

corner-shape: non-round corner shapes are ignored for composited content (<video>, images, composited descendants)#71079
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
cupidsity:video-corner-shape

Conversation

@cupidsity

@cupidsity cupidsity commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

e303a71

corner-shape: non-round corner shapes are ignored for composited content (<video>, images, composited descendants)
https://bugs.webkit.org/show_bug.cgi?id=321194
rdar://184258503

Reviewed by Simon Fraser.

This adds a shape mask for the cases the layer can clip itself, and
refuses the directly-composited fast paths for the cases it can't

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/LayerAncestorClippingStack.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
(WebCore::RenderLayerBacking::updateAppleVisualEffect):
(WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::contentsClippingRectForCornerShape):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
(WebCore::RenderLayerBacking::updateContentsRects):
(WebCore::boxNeedingShapeMaskForClip):
(WebCore::RenderLayerBacking::ensureClippingStackLayers):
(WebCore::RenderLayerBacking::removeClippingStackLayers):
(WebCore::RenderLayerBacking::updateClippingStackLayerGeometry):
(WebCore::RenderLayerBacking::needsCornerShapeMask const):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::supportsDirectlyCompositedBoxDecorations):
(WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
(WebCore::setContentsClipShapePath):
* Source/WebCore/rendering/RenderLayerBacking.h:
* Source/WebCore/rendering/style/BorderData.cpp:
(WebCore::BorderData::hasNonRoundCornerShape const):
(WebCore::BorderData::hasCornerShapeOutsideBorderRadius const):
(WebCore::BorderData::hasCornerShapeOutsideRoundedRect const):
* Source/WebCore/rendering/style/BorderData.h:
* LayoutTests/compositing/video/corner-shape-video-expected.html: Added.
* LayoutTests/compositing/video/corner-shape-video-overflow-expected.html: Added.
* LayoutTests/compositing/video/corner-shape-video-overflow.html: Added.
* LayoutTests/compositing/video/corner-shape-video.html: Added.
* Source/WebCore/rendering/LayerAncestorClippingStack.cpp:
(WebCore::LayerAncestorClippingStack::LayerAncestorClippingStack):
(WebCore::LayerAncestorClippingStack::updateWithClipData):
(WebCore::operator<<):
* Source/WebCore/platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::contentsClipShapePath const):
(WebCore::GraphicsLayer::setContentsClipShapePath):
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::contentsClipShapePathsAreEqual):
(WebCore::GraphicsLayerCA::setContentsClipShapePath):
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::setShapeLayerPath):
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* LayoutTests/compositing/corner-shape-ancestor-clip-expected.html: Added.
* LayoutTests/compositing/corner-shape-ancestor-clip.html: Added.
* LayoutTests/compositing/corner-shape-mask-layer-offset-expected.html: Added.
* LayoutTests/compositing/corner-shape-mask-layer-offset.html: Added.
* LayoutTests/compositing/corner-shape-ancestor-clip-shape-mask-expected.txt: Added.
* LayoutTests/compositing/corner-shape-ancestor-clip-shape-mask.html: Added.
* LayoutTests/fast/scrolling/corner-shape-nested-clips-overflow-scroll-expected.html: Added.
* LayoutTests/fast/scrolling/corner-shape-nested-clips-overflow-scroll.html: Added.
* LayoutTests/fast/scrolling/corner-shape-overflow-scroll-uneven-radii-expected.html: Added.
* LayoutTests/fast/scrolling/corner-shape-overflow-scroll-uneven-radii.html: Added.
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paintContents):
(WebCore::SkiaCompositingLayer::paintSelfAndChildren):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.cpp:
(WebCore::CoordinatedPlatformLayer::setContentsClipShapePath):
(WebCore::CoordinatedPlatformLayer::flushCompositingStateOnTarget):
(WebCore::CoordinatedPlatformLayer::flushCompositingStateOnSkiaTarget):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.h:
* Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.cpp:
(WebCore::GraphicsLayerCoordinated::setContentsClipShapePath):
(WebCore::GraphicsLayerCoordinated::setShapeLayerPath):
(WebCore::GraphicsLayerCoordinated::commitLayerChanges):
* Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.h:

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

b7ab564

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 ✅ 🧪 api-mac-debug
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-AS-debug-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-wk2-stress ✅ 🧪 gtk-wk2
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@cupidsity cupidsity self-assigned this Aug 6, 2026
@cupidsity cupidsity added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Aug 6, 2026
@cupidsity
cupidsity force-pushed the video-corner-shape branch from 4157550 to c0af633 Compare August 6, 2026 20:44
@cupidsity
cupidsity force-pushed the video-corner-shape branch from c0af633 to 89177bc Compare August 6, 2026 20:48
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 6, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 6, 2026
@cupidsity
cupidsity force-pushed the video-corner-shape branch from 89177bc to e94d80f Compare August 6, 2026 21:04
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 6, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 6, 2026
@cupidsity
cupidsity force-pushed the video-corner-shape branch from e94d80f to f38a271 Compare August 6, 2026 21:22
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 6, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 6, 2026
@cupidsity
cupidsity force-pushed the video-corner-shape branch from f38a271 to ab0c585 Compare August 6, 2026 23:22
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 7, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 12, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 12, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 12, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 12, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 12, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 13, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 13, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 14, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 14, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 15, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 15, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 15, 2026
@cupidsity cupidsity removed the merging-blocked Applied to prevent a change from being merged label Aug 16, 2026
@cupidsity cupidsity added the merge-queue Applied to send a pull request to merge-queue label Aug 16, 2026
…ent (<video>, images, composited descendants)

https://bugs.webkit.org/show_bug.cgi?id=321194
rdar://184258503

Reviewed by Simon Fraser.

This adds a shape mask for the cases the layer can clip itself, and
refuses the directly-composited fast paths for the cases it can't

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/LayerAncestorClippingStack.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
(WebCore::RenderLayerBacking::updateAppleVisualEffect):
(WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::contentsClippingRectForCornerShape):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
(WebCore::RenderLayerBacking::updateContentsRects):
(WebCore::boxNeedingShapeMaskForClip):
(WebCore::RenderLayerBacking::ensureClippingStackLayers):
(WebCore::RenderLayerBacking::removeClippingStackLayers):
(WebCore::RenderLayerBacking::updateClippingStackLayerGeometry):
(WebCore::RenderLayerBacking::needsCornerShapeMask const):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::supportsDirectlyCompositedBoxDecorations):
(WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
(WebCore::setContentsClipShapePath):
* Source/WebCore/rendering/RenderLayerBacking.h:
* Source/WebCore/rendering/style/BorderData.cpp:
(WebCore::BorderData::hasNonRoundCornerShape const):
(WebCore::BorderData::hasCornerShapeOutsideBorderRadius const):
(WebCore::BorderData::hasCornerShapeOutsideRoundedRect const):
* Source/WebCore/rendering/style/BorderData.h:
* LayoutTests/compositing/video/corner-shape-video-expected.html: Added.
* LayoutTests/compositing/video/corner-shape-video-overflow-expected.html: Added.
* LayoutTests/compositing/video/corner-shape-video-overflow.html: Added.
* LayoutTests/compositing/video/corner-shape-video.html: Added.
* Source/WebCore/rendering/LayerAncestorClippingStack.cpp:
(WebCore::LayerAncestorClippingStack::LayerAncestorClippingStack):
(WebCore::LayerAncestorClippingStack::updateWithClipData):
(WebCore::operator<<):
* Source/WebCore/platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::contentsClipShapePath const):
(WebCore::GraphicsLayer::setContentsClipShapePath):
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::contentsClipShapePathsAreEqual):
(WebCore::GraphicsLayerCA::setContentsClipShapePath):
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::setShapeLayerPath):
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* LayoutTests/compositing/corner-shape-ancestor-clip-expected.html: Added.
* LayoutTests/compositing/corner-shape-ancestor-clip.html: Added.
* LayoutTests/compositing/corner-shape-mask-layer-offset-expected.html: Added.
* LayoutTests/compositing/corner-shape-mask-layer-offset.html: Added.
* LayoutTests/compositing/corner-shape-ancestor-clip-shape-mask-expected.txt: Added.
* LayoutTests/compositing/corner-shape-ancestor-clip-shape-mask.html: Added.
* LayoutTests/fast/scrolling/corner-shape-nested-clips-overflow-scroll-expected.html: Added.
* LayoutTests/fast/scrolling/corner-shape-nested-clips-overflow-scroll.html: Added.
* LayoutTests/fast/scrolling/corner-shape-overflow-scroll-uneven-radii-expected.html: Added.
* LayoutTests/fast/scrolling/corner-shape-overflow-scroll-uneven-radii.html: Added.
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paintContents):
(WebCore::SkiaCompositingLayer::paintSelfAndChildren):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.cpp:
(WebCore::CoordinatedPlatformLayer::setContentsClipShapePath):
(WebCore::CoordinatedPlatformLayer::flushCompositingStateOnTarget):
(WebCore::CoordinatedPlatformLayer::flushCompositingStateOnSkiaTarget):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.h:
* Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.cpp:
(WebCore::GraphicsLayerCoordinated::setContentsClipShapePath):
(WebCore::GraphicsLayerCoordinated::setShapeLayerPath):
(WebCore::GraphicsLayerCoordinated::commitLayerChanges):
* Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.h:

Canonical link: https://commits.webkit.org/319257@main
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 319257@main (e303a71): https://commits.webkit.org/319257@main

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

@webkit-commit-queue
webkit-commit-queue merged commit e303a71 into WebKit:main Aug 16, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Aug 16, 2026
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