Commit c3229c2
committed
[@Property] Handle dependency cycles involving root style
https://bugs.webkit.org/show_bug.cgi?id=250703
rdar://104324136
Reviewed by Alan Baradlay.
'rem' unit and others can create dependency cycles that apply to the document element style only.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt:
* Source/WebCore/css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::collectComputedStyleDependencies const):
Use Vector instead of a HashMap since there are never very many of these properties.
(WebCore::CSSPrimitiveValue::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSPrimitiveValue::collectDirectRootComputationalDependencies const): Deleted.
Factor these to a single function that collect both root and normal dependencies.
* Source/WebCore/css/CSSPrimitiveValue.h:
* Source/WebCore/css/CSSValue.cpp:
(WebCore::CSSValue::computedStyleDependencies const):
(WebCore::CSSValue::collectComputedStyleDependencies const):
(WebCore::CSSValue::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSValue::collectDirectRootComputationalDependencies const): Deleted.
* Source/WebCore/css/CSSValue.h:
(WebCore::ComputedStyleDependencies::isEmpty const):
* Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* Source/WebCore/css/calc/CSSCalcExpressionNode.h:
* Source/WebCore/css/calc/CSSCalcInvertNode.h:
* Source/WebCore/css/calc/CSSCalcNegateNode.h:
* Source/WebCore/css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::collectComputedStyleDependencies const):
(WebCore::CSSCalcOperationNode::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSCalcOperationNode::collectDirectRootComputationalDependencies const): Deleted.
* Source/WebCore/css/calc/CSSCalcOperationNode.h:
* Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.cpp:
(WebCore::CSSCalcPrimitiveValueNode::collectComputedStyleDependencies const):
(WebCore::CSSCalcPrimitiveValueNode::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSCalcPrimitiveValueNode::collectDirectRootComputationalDependencies const): Deleted.
* Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.h:
* Source/WebCore/css/calc/CSSCalcValue.cpp:
(WebCore::CSSCalcValue::collectComputedStyleDependencies const):
(WebCore::CSSCalcValue::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSCalcValue::collectDirectRootComputationalDependencies const): Deleted.
* Source/WebCore/css/calc/CSSCalcValue.h:
* Source/WebCore/css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseCustomPropertyValueWithVariableReferences):
Check for root style dependencies if needed.
Always mark all cycles. This could have impact in some sort of multi-property cycle case.
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
* Source/WebCore/css/parser/CSSPropertyParser.h:
* Source/WebCore/style/CustomPropertyRegistry.cpp:
(WebCore::Style::CustomPropertyRegistry::registerFromStylesheet):
* Source/WebCore/style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::shouldApplyAfterAnimation):
Canonical link: https://commits.webkit.org/258985@main1 parent a5b1dde commit c3229c2
File tree
20 files changed
+76
-102
lines changed- LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api
- Source/WebCore
- css
- calc
- parser
- style
20 files changed
+76
-102
lines changedLayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1674 | 1674 | | |
1675 | 1675 | | |
1676 | 1676 | | |
1677 | | - | |
| 1677 | + | |
1678 | 1678 | | |
1679 | 1679 | | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
1680 | 1687 | | |
1681 | 1688 | | |
1682 | 1689 | | |
1683 | 1690 | | |
1684 | 1691 | | |
1685 | | - | |
| 1692 | + | |
1686 | 1693 | | |
1687 | 1694 | | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
1693 | | - | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
1702 | | - | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
| 1695 | + | |
| 1696 | + | |
1708 | 1697 | | |
1709 | 1698 | | |
1710 | | - | |
| 1699 | + | |
1711 | 1700 | | |
1712 | 1701 | | |
1713 | 1702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
| 205 | + | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
235 | 230 | | |
236 | 231 | | |
237 | | - | |
| 232 | + | |
238 | 233 | | |
239 | 234 | | |
240 | 235 | | |
241 | | - | |
| 236 | + | |
242 | 237 | | |
243 | 238 | | |
244 | 239 | | |
245 | 240 | | |
246 | | - | |
| 241 | + | |
247 | 242 | | |
248 | 243 | | |
249 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
36 | 44 | | |
37 | 45 | | |
38 | 46 | | |
| |||
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
125 | | - | |
126 | | - | |
127 | | - | |
| 133 | + | |
| 134 | + | |
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
1075 | | - | |
| 1075 | + | |
1076 | 1076 | | |
1077 | 1077 | | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
| 1078 | + | |
1085 | 1079 | | |
1086 | 1080 | | |
1087 | 1081 | | |
| |||
0 commit comments