Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 842fe4de0fa5058b06babff939f609eb1ec7dbbb
https://github.com/WebKit/WebKit/commit/842fe4de0fa5058b06babff939f609eb1ec7dbbb
Author: lilly <[email protected]>
Date: 2026-06-26 (Fri, 26 Jun 2026)
Changed paths:
M Source/WebCore/platform/graphics/CornerShapeUtilities.cpp
M Source/WebCore/platform/graphics/CornerShapeUtilities.h
M Source/WebCore/rendering/BorderShape.cpp
Log Message:
-----------
BorderShape: Implement corner-shape path generation and painting
https://bugs.webkit.org/show_bug.cgi?id=317933
rdar://180731272
Reviewed by Simon Fraser.
This patch implements all the functions that contained stubs as well as two
helpers,
buildCornerInputs and buildScaledCornerInputs, that translate a FloatRoundedRect
and per-corner curvature values into CornerInput structs for borderContourPath.
buildScaledCornerInputs additionally applies the
oppositeCornerScaleFactor(still a stub)
shrink when adjacent corners overlap, repositioning each corner rect to keep it
anchored to the correct edge. The patch also fixes a pre-existing bug in
cornerCurvaturesFromStyle and hasNonRoundCornerShape where bottomLeft and
bottomRight were ordered incorrectly in the RectCorners initializer.
Passes existing tests
* Source/WebCore/platform/graphics/CornerShapeUtilities.cpp:
(WebCore::borderContourPath):
(WebCore::oppositeCornerScaleFactor):
* Source/WebCore/platform/graphics/CornerShapeUtilities.h:
* Source/WebCore/rendering/BorderShape.cpp:
(WebCore::cornerCurvaturesFromStyle):
(WebCore::buildCornerInputs):
(WebCore::buildScaledCornerInputs):
(WebCore::BorderShape::hasNonRoundCornerShape const):
(WebCore::addOuterCornerShapeToPath):
(WebCore::BorderShape::pathForOuterCornerShape const):
(WebCore::addInnerCornerShapeToPath):
(WebCore::BorderShape::pathForInnerCornerShape const):
(WebCore::BorderShape::addOuterShapeToPath const):
(WebCore::BorderShape::addInnerShapeToPath const):
(WebCore::BorderShape::pathForBorderArea const):
(WebCore::BorderShape::fillOuterShape const):
(WebCore::BorderShape::fillInnerShape const):
(WebCore::BorderShape::fillRectWithInnerHoleShape const):
Canonical link: https://commits.webkit.org/315941@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications