Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c150a5007f05d085d9c422618fa819df622420c6
https://github.com/WebKit/WebKit/commit/c150a5007f05d085d9c422618fa819df622420c6
Author: Helmut Januschka <[email protected]>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
A LayoutTests/fast/css/corner-shorthands-expected.txt
A LayoutTests/fast/css/corner-shorthands.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-computed-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-computed.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-valid-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-writing-modes-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-computed-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-computed.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-computed-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-computed.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-left-computed-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-left-computed.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-left-valid-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-valid-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-valid-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-valid.html
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/css/CSSProperties.json
M Source/WebCore/css/ShorthandSerializer.cpp
M Source/WebCore/css/parser/CSSPropertyParserCustom.h
M Source/WebCore/style/StyleExtractorCustom.h
Log Message:
-----------
Implement the CSS corner and corner-* shorthands
https://bugs.webkit.org/show_bug.cgi?id=325010
Reviewed by Simon Fraser.
https://drafts.csswg.org/css-borders-4/#corner-shorthand
WebKit already supports the corner-shape longhands and the corner-*-shape
side shorthands. Add the 17 combination shorthands that set a corner's
radius and its shape together, behind the new CSSCornersShorthandEnabled
setting:
- corner-{top,bottom}-{left,right} and corner-{start,end}-{start,end}
- corner-{top,right,bottom,left}
- corner-{block,inline}-{start,end}
- corner
Each corner is parsed as `normal | <corner-shape>? <border-radius-corner>
<corner-shape>?`, where `normal` is equivalent to a zero radius with a
round shape. The side and master shorthands take slash-separated corners
and expand them the same way a CSS quad does, and both inline style and
computed style serialization collapse corners that are equal. Since
`round` computes to `superellipse(1)`, the `normal` collapsing accepts
either spelling of a round corner.
The in-tree copies of five of the imported web platform tests predate
https://github.com/web-platform-tests/wpt/commit/c9c2cdd485d4a9e2c1367c7295b7164c28ab5598
and still expected corner shapes to serialize as keywords in computed
values. Update them to their current upstream revision, which expects the
superellipse() serialization WebKit already produces for the longhands.
Tests: fast/css/corner-shorthands.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-computed.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-valid.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-writing-modes.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-computed.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-computed.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-left-computed.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-left-valid.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-valid.html
imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-valid.html
* LayoutTests/fast/css/corner-shorthands-expected.txt: Added.
* LayoutTests/fast/css/corner-shorthands.html: Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-computed-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-computed.html:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-valid-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-block-start-writing-modes-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-computed-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-computed.html:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-computed-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-computed.html:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-left-computed-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-left-computed.html:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-left-valid-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-top-valid-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-valid-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-borders/corner-shape/corner-valid.html:
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::cornerShorthandRadiusIsZero):
(WebCore::cornerShorthandShapeIsRound):
(WebCore::ShorthandSerializer::serialize):
(WebCore::ShorthandSerializer::serializeOneCorner const):
(WebCore::ShorthandSerializer::serializeCornerSingle const):
(WebCore::ShorthandSerializer::serializeCornerPair const):
(WebCore::ShorthandSerializer::serializeCornerQuad const):
* Source/WebCore/css/parser/CSSPropertyParserCustom.h:
(WebCore::CSS::CornerShorthandHelpers::zeroRadius):
(WebCore::CSS::CornerShorthandHelpers::roundShape):
(WebCore::CSS::CornerShorthandHelpers::consumeOneCorner):
(WebCore::CSS::PropertyParserCustom::consumeCornerSingleShorthand):
(WebCore::CSS::PropertyParserCustom::consumeCornerPairShorthand):
(WebCore::CSS::PropertyParserCustom::consumeCornerQuadShorthand):
* Source/WebCore/style/StyleExtractorCustom.h:
(WebCore::Style::isRoundCornerShapeValue):
(WebCore::Style::isCornerNormalValue):
(WebCore::Style::buildCornerValue):
(WebCore::Style::extractCornerSingleShorthand):
(WebCore::Style::extractCornerSingleShorthandSerialization):
(WebCore::Style::extractCornerPairShorthand):
(WebCore::Style::extractCornerPairShorthandSerialization):
(WebCore::Style::extractCornerQuadShorthand):
(WebCore::Style::extractCornerQuadShorthandSerialization):
Canonical link: https://commits.webkit.org/321773@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications