Skip to content

Commit 111a7fe

Browse files
committed
Update border-*-width to match updated computed style resolution rules
https://bugs.webkit.org/show_bug.cgi?id=304965 Reviewed by Darin Adler. The rules for the `border-*-width` properties' computed value resolution were updated with w3c/csswg-drafts#11494 to disentangle `border-*-width` and `border-*-style` for computed style, making `border-*-style` only effect the used value, and unlike `outline-width` and `column-rule-width` the resolved (getComputedStyle) value. As was done with `outline-width` and `column-rule-width`, `RenderStyle::border{...}Width()` have been removed and replaced by `RenderStyle::usedBorder{...}Width()`. Additionally, the logical versions have also been removed (via new checks in the generator), and replaced. To simplify the implementation in RenderStyle, a new `RectEdgesView` type was added (building on the `BorderEdgeView` type from `BorderData`) that allows returning a `RectEdge` like type for data that either needs to be transformed, as we do for the used border width values or are just disjoint. * LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-width-interpolation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-width-interpolation.html: * LayoutTests/js/suppress-asan-on-clobberize-to-workaround-asan-bug-expected.txt: * LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-width-interpolation-expected.txt: * Source/WebCore/css/CSSProperties.json: * Source/WebCore/css/scripts/process-css-properties.py: * Source/WebCore/css/values/CSSValueAggregates.h: * Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp: * Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp: * Source/WebCore/layout/integration/LayoutIntegrationBoxGeometryUpdater.cpp: * Source/WebCore/page/InteractionRegion.cpp: * Source/WebCore/page/SpatialNavigation.cpp: * Source/WebCore/platform/RectEdges.h: * Source/WebCore/rendering/BorderEdge.cpp: * Source/WebCore/rendering/BorderShape.cpp: * Source/WebCore/rendering/NinePieceImagePainter.cpp: * Source/WebCore/rendering/RenderBlock.cpp: * Source/WebCore/rendering/RenderBoxModelObjectInlines.h: * Source/WebCore/rendering/RenderTableRow.cpp: * Source/WebCore/rendering/RenderTheme.cpp: * Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm: * Source/WebCore/rendering/ios/RenderThemeIOS.mm: * Source/WebCore/rendering/style/BorderData.h: * Source/WebCore/rendering/style/RenderStyle+GettersInlines.h: * Source/WebCore/rendering/style/RenderStyle.cpp: * Source/WebCore/rendering/style/RenderStyle.h: * Source/WebCore/rendering/style/RenderStyleBase+GettersInlines.h: * Source/WebCore/rendering/style/RenderStyleBase.h: * Source/WebCore/style/StyleDifference.cpp: * Source/WebCore/style/StyleExtractorCustom.h: * Source/WebCore/style/computed/StyleComputedStyleBase+GettersInlines.h: * Source/WebCore/style/computed/StyleComputedStyleBase.h: * Source/WebCore/style/computed/StyleComputedStyleProperties+GettersCustomInlines.h: * Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm: * Source/WebKitLegacy/mac/DOM/DOM.mm: Canonical link: https://commits.webkit.org/305212@main
1 parent ad9aad6 commit 111a7fe

35 files changed

+490
-255
lines changed

LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-width-interpolation-expected.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,30 +71,30 @@ PASS Web Animations: property <border-left-width> from [initial] to [23px] at (0
7171
PASS Web Animations: property <border-left-width> from [initial] to [23px] at (0.6) should be [15px]
7272
PASS Web Animations: property <border-left-width> from [initial] to [23px] at (1) should be [23px]
7373
PASS Web Animations: property <border-left-width> from [initial] to [23px] at (1.5) should be [33px]
74-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [0px]
75-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0) should be [0px]
76-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0.3) should be [6px]
77-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0.6) should be [12px]
74+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [33px]
75+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0) should be [30px]
76+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0.3) should be [27px]
77+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0.6) should be [24px]
7878
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (1) should be [20px]
79-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (1.5) should be [30px]
80-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [0px]
81-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0) should be [0px]
82-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0.3) should be [6px]
83-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0.6) should be [12px]
79+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (1.5) should be [15px]
80+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [33px]
81+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0) should be [30px]
82+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0.3) should be [27px]
83+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0.6) should be [24px]
8484
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (1) should be [20px]
85-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (1.5) should be [30px]
86-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [0px]
87-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0) should be [0px]
88-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0.3) should be [6px]
89-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0.6) should be [12px]
85+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (1.5) should be [15px]
86+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [33px]
87+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0) should be [30px]
88+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0.3) should be [27px]
89+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0.6) should be [24px]
9090
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (1) should be [20px]
91-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (1.5) should be [30px]
92-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [0px]
93-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0) should be [0px]
94-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0.3) should be [6px]
95-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0.6) should be [12px]
91+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (1.5) should be [15px]
92+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [33px]
93+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0) should be [30px]
94+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0.3) should be [27px]
95+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0.6) should be [24px]
9696
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (1) should be [20px]
97-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (1.5) should be [30px]
97+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (1.5) should be [15px]
9898
PASS CSS Transitions: property <border-left-width> from [unset] to [23px] at (-0.3) should be [0px]
9999
PASS CSS Transitions: property <border-left-width> from [unset] to [23px] at (0) should be [3px]
100100
PASS CSS Transitions: property <border-left-width> from [unset] to [23px] at (0.3) should be [9px]

LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-width-interpolation.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@
8383
from: 'inherit',
8484
to: '20px',
8585
}, [
86-
{at: -0.3, expect: '0px'},
87-
{at: 0, expect: '0px'},
88-
{at: 0.3, expect: '6px'},
89-
{at: 0.6, expect: '12px'},
86+
{at: -0.3, expect: '33px'},
87+
{at: 0, expect: '30px'},
88+
{at: 0.3, expect: '27px'},
89+
{at: 0.6, expect: '24px'},
9090
{at: 1, expect: '20px'},
91-
{at: 1.5, expect: '30px'},
91+
{at: 1.5, expect: '15px'},
9292
]);
9393

9494
test_interpolation({
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CONSOLE MESSAGE: TypeError: undefined is not an object (evaluating 'animation.effect = new KeyframeEffect(li, [ { } ], 6)')
21
This test passes if there is no crash.
32

43

LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-width-interpolation-expected.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,30 +71,30 @@ PASS Web Animations: property <border-left-width> from [initial] to [23px] at (0
7171
PASS Web Animations: property <border-left-width> from [initial] to [23px] at (0.6) should be [15px]
7272
PASS Web Animations: property <border-left-width> from [initial] to [23px] at (1) should be [23px]
7373
PASS Web Animations: property <border-left-width> from [initial] to [23px] at (1.5) should be [33px]
74-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [0px]
75-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0) should be [0px]
76-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0.3) should be [6px]
77-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0.6) should be [12px]
74+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [33px]
75+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0) should be [30px]
76+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0.3) should be [27px]
77+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (0.6) should be [24px]
7878
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (1) should be [20px]
79-
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (1.5) should be [30px]
80-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [0px]
81-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0) should be [0px]
82-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0.3) should be [6px]
83-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0.6) should be [12px]
79+
PASS CSS Transitions: property <border-left-width> from [inherit] to [20px] at (1.5) should be [15px]
80+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [33px]
81+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0) should be [30px]
82+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0.3) should be [27px]
83+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (0.6) should be [24px]
8484
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (1) should be [20px]
85-
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (1.5) should be [30px]
86-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [0px]
87-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0) should be [0px]
88-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0.3) should be [6px]
89-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0.6) should be [12px]
85+
PASS CSS Transitions with transition: all: property <border-left-width> from [inherit] to [20px] at (1.5) should be [15px]
86+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [33px]
87+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0) should be [30px]
88+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0.3) should be [27px]
89+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (0.6) should be [24px]
9090
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (1) should be [20px]
91-
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (1.5) should be [30px]
92-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [0px]
93-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0) should be [0px]
94-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0.3) should be [6px]
95-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0.6) should be [12px]
91+
PASS CSS Animations: property <border-left-width> from [inherit] to [20px] at (1.5) should be [15px]
92+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (-0.3) should be [33px]
93+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0) should be [30px]
94+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0.3) should be [27px]
95+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (0.6) should be [24px]
9696
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (1) should be [20px]
97-
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (1.5) should be [30px]
97+
PASS Web Animations: property <border-left-width> from [inherit] to [20px] at (1.5) should be [15px]
9898
PASS CSS Transitions: property <border-left-width> from [unset] to [23px] at (-0.3) should be [0px]
9999
PASS CSS Transitions: property <border-left-width> from [unset] to [23px] at (0) should be [3px]
100100
PASS CSS Transitions: property <border-left-width> from [unset] to [23px] at (0.3) should be [9px]

Source/WebCore/css/CSSProperties.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,15 +2985,15 @@
29852985
},
29862986
"accepts-quirky-length": true,
29872987
"style-builder-custom": "Initial",
2988+
"style-extractor-custom": true,
29882989
"disables-native-appearance": true,
29892990
"computed-style-initial-constexpr": true,
29902991
"computed-style-initial-custom": true,
2991-
"computed-style-getter-custom": true,
2992-
"computed-style-storage-name": "width",
2993-
"computed-style-storage-path": ["m_nonInheritedData", "surroundData", "border.edges.bottom()"],
2994-
"computed-style-storage-container": "struct",
2995-
"computed-style-storage-kind": "value",
2992+
"computed-style-storage-path": ["m_nonInheritedData", "surroundData", "border.widths()"],
2993+
"computed-style-storage-container": "physical-group",
2994+
"computed-style-storage-kind": "reference",
29962995
"computed-style-type": "Style::LineWidth",
2996+
"skip-render-style-getter": true,
29972997
"parser-grammar": "<line-width>"
29982998
},
29992999
"specification": {
@@ -3542,15 +3542,15 @@
35423542
},
35433543
"accepts-quirky-length": true,
35443544
"style-builder-custom": "Initial",
3545+
"style-extractor-custom": true,
35453546
"disables-native-appearance": true,
35463547
"computed-style-initial-constexpr": true,
35473548
"computed-style-initial-custom": true,
3548-
"computed-style-getter-custom": true,
3549-
"computed-style-storage-name": "width",
3550-
"computed-style-storage-path": ["m_nonInheritedData", "surroundData", "border.edges.left()"],
3551-
"computed-style-storage-container": "struct",
3552-
"computed-style-storage-kind": "value",
3549+
"computed-style-storage-path": ["m_nonInheritedData", "surroundData", "border.widths()"],
3550+
"computed-style-storage-container": "physical-group",
3551+
"computed-style-storage-kind": "reference",
35533552
"computed-style-type": "Style::LineWidth",
3553+
"skip-render-style-getter": true,
35543554
"parser-grammar": "<line-width>"
35553555
},
35563556
"specification": {
@@ -3663,15 +3663,15 @@
36633663
},
36643664
"accepts-quirky-length": true,
36653665
"style-builder-custom": "Initial",
3666+
"style-extractor-custom": true,
36663667
"disables-native-appearance": true,
36673668
"computed-style-initial-constexpr": true,
36683669
"computed-style-initial-custom": true,
3669-
"computed-style-getter-custom": true,
3670-
"computed-style-storage-name": "width",
3671-
"computed-style-storage-path": ["m_nonInheritedData", "surroundData", "border.edges.right()"],
3672-
"computed-style-storage-container": "struct",
3673-
"computed-style-storage-kind": "value",
3670+
"computed-style-storage-path": ["m_nonInheritedData", "surroundData", "border.widths()"],
3671+
"computed-style-storage-container": "physical-group",
3672+
"computed-style-storage-kind": "reference",
36743673
"computed-style-type": "Style::LineWidth",
3674+
"skip-render-style-getter": true,
36753675
"parser-grammar": "<line-width>"
36763676
},
36773677
"specification": {
@@ -3889,15 +3889,15 @@
38893889
},
38903890
"accepts-quirky-length": true,
38913891
"style-builder-custom": "Initial",
3892+
"style-extractor-custom": true,
38923893
"disables-native-appearance": true,
38933894
"computed-style-initial-constexpr": true,
38943895
"computed-style-initial-custom": true,
3895-
"computed-style-getter-custom": true,
3896-
"computed-style-storage-name": "width",
3897-
"computed-style-storage-path": ["m_nonInheritedData", "surroundData", "border.edges.top()"],
3898-
"computed-style-storage-container": "struct",
3899-
"computed-style-storage-kind": "value",
3896+
"computed-style-storage-path": ["m_nonInheritedData", "surroundData", "border.widths()"],
3897+
"computed-style-storage-container": "physical-group",
3898+
"computed-style-storage-kind": "reference",
39003899
"computed-style-type": "Style::LineWidth",
3900+
"skip-render-style-getter": true,
39013901
"parser-grammar": "<line-width>"
39023902
},
39033903
"specification": {

0 commit comments

Comments
 (0)