Commit 644e1dd
committed
[css-nesting] CSSNestedDeclarations inside @scope should resolve to :where(:scope)
https://bugs.webkit.org/show_bug.cgi?id=280544
rdar://136856371
Reviewed by Sammy Gill.
w3c/csswg-drafts#10431
This patch maintains a stack during rule set building to be able
to determine whether the closest ancestor rule is a style rule or a scope rule,
and to resolve the nesting parent selector & appropriately (:is(<parent>) or :where(:scope)).
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nested-declarations-matching-expected.txt:
* Source/WebCore/style/RuleSetBuilder.cpp:
(WebCore::Style::RuleSetBuilder::addChildRule):
(WebCore::Style::RuleSetBuilder::resolveSelectorListWithNesting):
(WebCore::Style::RuleSetBuilder::addStyleRule):
* Source/WebCore/style/RuleSetBuilder.h:
Canonical link: https://commits.webkit.org/284635@main1 parent d762e9f commit 644e1dd
File tree
3 files changed
+31
-7
lines changed- LayoutTests/imported/w3c/web-platform-tests/css/css-nesting
- Source/WebCore/style
3 files changed
+31
-7
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
152 | 153 | | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
278 | | - | |
| 280 | + | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
| |||
303 | 305 | | |
304 | 306 | | |
305 | 307 | | |
306 | | - | |
| 308 | + | |
307 | 309 | | |
308 | 310 | | |
309 | 311 | | |
310 | 312 | | |
| 313 | + | |
311 | 314 | | |
312 | 315 | | |
| 316 | + | |
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
| |||
320 | 324 | | |
321 | 325 | | |
322 | 326 | | |
323 | | - | |
324 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
325 | 347 | | |
326 | 348 | | |
327 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
0 commit comments