Skip to content

Commit cd7efe6

Browse files
committed
Do not require whitespace between of and selector list in :nth-child/:nth-last-child
https://bugs.webkit.org/show_bug.cgi?id=250353 rdar://104058693 Reviewed by Simon Fraser. As clarified by CSSWG editors in: w3c/csswg-drafts#8285 Tests: - LayoutTests/imported/w3c/web-platform-tests/css/selectors/nth-child-of-no-space-after-of.html - LayoutTests/imported/w3c/web-platform-tests/css/selectors/nth-last-child-of-no-space-after-of.html * LayoutTests/TestExpectations: * LayoutTests/fast/css/parsing-css-nth-child-of-3-expected.txt: * LayoutTests/fast/css/parsing-css-nth-child-of-3.html: * LayoutTests/fast/css/parsing-css-nth-last-child-of-3-expected.txt: * LayoutTests/fast/css/parsing-css-nth-last-child-of-3.html: * Source/WebCore/css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumePseudo): Canonical link: https://commits.webkit.org/258703@main
1 parent d99cd24 commit cd7efe6

File tree

6 files changed

+0
-58
lines changed

6 files changed

+0
-58
lines changed

LayoutTests/TestExpectations

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,8 +1634,6 @@ webkit.org/b/217904 imported/w3c/web-platform-tests/css/selectors/is-where-visit
16341634
imported/w3c/web-platform-tests/css/selectors/xml-class-selector.xml [ ImageOnlyFailure ]
16351635
webkit.org/b/238822 imported/w3c/web-platform-tests/css/selectors/child-indexed-no-parent.html [ ImageOnlyFailure ]
16361636
webkit.org/b/238822 imported/w3c/web-platform-tests/css/selectors/selector-structural-pseudo-root.html [ ImageOnlyFailure ]
1637-
webkit.org/b/250353 imported/w3c/web-platform-tests/css/selectors/nth-child-of-no-space-after-of.html [ ImageOnlyFailure ]
1638-
webkit.org/b/250353 imported/w3c/web-platform-tests/css/selectors/nth-last-child-of-no-space-after-of.html [ ImageOnlyFailure ]
16391637

16401638
# This test is bit heavy for debug
16411639
[ Debug ] imported/w3c/web-platform-tests/css/selectors/invalidation/has-complexity.html [ Skip ]

LayoutTests/fast/css/parsing-css-nth-child-of-3-expected.txt

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,104 +8,78 @@ PASS document.querySelector(":nth-child(even of)") threw exception SyntaxError:
88
PASS document.getElementById('style-container').sheet.cssRules.length is 0
99
PASS document.querySelector(":nth-child(even of )") threw exception SyntaxError: The string did not match the expected pattern..
1010
PASS document.getElementById('style-container').sheet.cssRules.length is 0
11-
PASS document.querySelector(":nth-child(even of.class)") threw exception SyntaxError: The string did not match the expected pattern..
12-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
1311
PASS document.querySelector(":nth-child(evenof .class)") threw exception SyntaxError: The string did not match the expected pattern..
1412
PASS document.getElementById('style-container').sheet.cssRules.length is 0
1513
PASS document.querySelector(":nth-child(odd of)") threw exception SyntaxError: The string did not match the expected pattern..
1614
PASS document.getElementById('style-container').sheet.cssRules.length is 0
1715
PASS document.querySelector(":nth-child(odd of )") threw exception SyntaxError: The string did not match the expected pattern..
1816
PASS document.getElementById('style-container').sheet.cssRules.length is 0
19-
PASS document.querySelector(":nth-child(odd of.class)") threw exception SyntaxError: The string did not match the expected pattern..
20-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
2117
PASS document.querySelector(":nth-child(oddof .class)") threw exception SyntaxError: The string did not match the expected pattern..
2218
PASS document.getElementById('style-container').sheet.cssRules.length is 0
2319
PASS document.querySelector(":nth-child(n of)") threw exception SyntaxError: The string did not match the expected pattern..
2420
PASS document.getElementById('style-container').sheet.cssRules.length is 0
2521
PASS document.querySelector(":nth-child(n of )") threw exception SyntaxError: The string did not match the expected pattern..
2622
PASS document.getElementById('style-container').sheet.cssRules.length is 0
27-
PASS document.querySelector(":nth-child(n of.class)") threw exception SyntaxError: The string did not match the expected pattern..
28-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
2923
PASS document.querySelector(":nth-child(nof .class)") threw exception SyntaxError: The string did not match the expected pattern..
3024
PASS document.getElementById('style-container').sheet.cssRules.length is 0
3125
PASS document.querySelector(":nth-child(-n of)") threw exception SyntaxError: The string did not match the expected pattern..
3226
PASS document.getElementById('style-container').sheet.cssRules.length is 0
3327
PASS document.querySelector(":nth-child(-n of )") threw exception SyntaxError: The string did not match the expected pattern..
3428
PASS document.getElementById('style-container').sheet.cssRules.length is 0
35-
PASS document.querySelector(":nth-child(-n of.class)") threw exception SyntaxError: The string did not match the expected pattern..
36-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
3729
PASS document.querySelector(":nth-child(-nof .class)") threw exception SyntaxError: The string did not match the expected pattern..
3830
PASS document.getElementById('style-container').sheet.cssRules.length is 0
3931
PASS document.querySelector(":nth-child(3 of)") threw exception SyntaxError: The string did not match the expected pattern..
4032
PASS document.getElementById('style-container').sheet.cssRules.length is 0
4133
PASS document.querySelector(":nth-child(3 of )") threw exception SyntaxError: The string did not match the expected pattern..
4234
PASS document.getElementById('style-container').sheet.cssRules.length is 0
43-
PASS document.querySelector(":nth-child(3 of.class)") threw exception SyntaxError: The string did not match the expected pattern..
44-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
4535
PASS document.querySelector(":nth-child(3of .class)") threw exception SyntaxError: The string did not match the expected pattern..
4636
PASS document.getElementById('style-container').sheet.cssRules.length is 0
4737
PASS document.querySelector(":nth-child(-3 of)") threw exception SyntaxError: The string did not match the expected pattern..
4838
PASS document.getElementById('style-container').sheet.cssRules.length is 0
4939
PASS document.querySelector(":nth-child(-3 of )") threw exception SyntaxError: The string did not match the expected pattern..
5040
PASS document.getElementById('style-container').sheet.cssRules.length is 0
51-
PASS document.querySelector(":nth-child(-3 of.class)") threw exception SyntaxError: The string did not match the expected pattern..
52-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
5341
PASS document.querySelector(":nth-child(-3of .class)") threw exception SyntaxError: The string did not match the expected pattern..
5442
PASS document.getElementById('style-container').sheet.cssRules.length is 0
5543
PASS document.querySelector(":nth-child(n+0 of)") threw exception SyntaxError: The string did not match the expected pattern..
5644
PASS document.getElementById('style-container').sheet.cssRules.length is 0
5745
PASS document.querySelector(":nth-child(n+0 of )") threw exception SyntaxError: The string did not match the expected pattern..
5846
PASS document.getElementById('style-container').sheet.cssRules.length is 0
59-
PASS document.querySelector(":nth-child(n+0 of.class)") threw exception SyntaxError: The string did not match the expected pattern..
60-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
6147
PASS document.querySelector(":nth-child(n+0of .class)") threw exception SyntaxError: The string did not match the expected pattern..
6248
PASS document.getElementById('style-container').sheet.cssRules.length is 0
6349
PASS document.querySelector(":nth-child(n-0 of)") threw exception SyntaxError: The string did not match the expected pattern..
6450
PASS document.getElementById('style-container').sheet.cssRules.length is 0
6551
PASS document.querySelector(":nth-child(n-0 of )") threw exception SyntaxError: The string did not match the expected pattern..
6652
PASS document.getElementById('style-container').sheet.cssRules.length is 0
67-
PASS document.querySelector(":nth-child(n-0 of.class)") threw exception SyntaxError: The string did not match the expected pattern..
68-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
6953
PASS document.querySelector(":nth-child(n-0of .class)") threw exception SyntaxError: The string did not match the expected pattern..
7054
PASS document.getElementById('style-container').sheet.cssRules.length is 0
7155
PASS document.querySelector(":nth-child(0n of)") threw exception SyntaxError: The string did not match the expected pattern..
7256
PASS document.getElementById('style-container').sheet.cssRules.length is 0
7357
PASS document.querySelector(":nth-child(0n of )") threw exception SyntaxError: The string did not match the expected pattern..
7458
PASS document.getElementById('style-container').sheet.cssRules.length is 0
75-
PASS document.querySelector(":nth-child(0n of.class)") threw exception SyntaxError: The string did not match the expected pattern..
76-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
7759
PASS document.querySelector(":nth-child(0nof .class)") threw exception SyntaxError: The string did not match the expected pattern..
7860
PASS document.getElementById('style-container').sheet.cssRules.length is 0
7961
PASS document.querySelector(":nth-child(3n+5 of)") threw exception SyntaxError: The string did not match the expected pattern..
8062
PASS document.getElementById('style-container').sheet.cssRules.length is 0
8163
PASS document.querySelector(":nth-child(3n+5 of )") threw exception SyntaxError: The string did not match the expected pattern..
8264
PASS document.getElementById('style-container').sheet.cssRules.length is 0
83-
PASS document.querySelector(":nth-child(3n+5 of.class)") threw exception SyntaxError: The string did not match the expected pattern..
84-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
8565
PASS document.querySelector(":nth-child(3n+5of .class)") threw exception SyntaxError: The string did not match the expected pattern..
8666
PASS document.getElementById('style-container').sheet.cssRules.length is 0
8767
PASS document.querySelector(":nth-child(-3n+5 of)") threw exception SyntaxError: The string did not match the expected pattern..
8868
PASS document.getElementById('style-container').sheet.cssRules.length is 0
8969
PASS document.querySelector(":nth-child(-3n+5 of )") threw exception SyntaxError: The string did not match the expected pattern..
9070
PASS document.getElementById('style-container').sheet.cssRules.length is 0
91-
PASS document.querySelector(":nth-child(-3n+5 of.class)") threw exception SyntaxError: The string did not match the expected pattern..
92-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
9371
PASS document.querySelector(":nth-child(-3n+5of .class)") threw exception SyntaxError: The string did not match the expected pattern..
9472
PASS document.getElementById('style-container').sheet.cssRules.length is 0
9573
PASS document.querySelector(":nth-child(3n-5 of)") threw exception SyntaxError: The string did not match the expected pattern..
9674
PASS document.getElementById('style-container').sheet.cssRules.length is 0
9775
PASS document.querySelector(":nth-child(3n-5 of )") threw exception SyntaxError: The string did not match the expected pattern..
9876
PASS document.getElementById('style-container').sheet.cssRules.length is 0
99-
PASS document.querySelector(":nth-child(3n-5 of.class)") threw exception SyntaxError: The string did not match the expected pattern..
100-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
10177
PASS document.querySelector(":nth-child(3n-5of .class)") threw exception SyntaxError: The string did not match the expected pattern..
10278
PASS document.getElementById('style-container').sheet.cssRules.length is 0
10379
PASS document.querySelector(":nth-child(-3n-5 of)") threw exception SyntaxError: The string did not match the expected pattern..
10480
PASS document.getElementById('style-container').sheet.cssRules.length is 0
10581
PASS document.querySelector(":nth-child(-3n-5 of )") threw exception SyntaxError: The string did not match the expected pattern..
10682
PASS document.getElementById('style-container').sheet.cssRules.length is 0
107-
PASS document.querySelector(":nth-child(-3n-5 of.class)") threw exception SyntaxError: The string did not match the expected pattern..
108-
PASS document.getElementById('style-container').sheet.cssRules.length is 0
10983
PASS document.querySelector(":nth-child(-3n-5of .class)") threw exception SyntaxError: The string did not match the expected pattern..
11084
PASS document.getElementById('style-container').sheet.cssRules.length is 0
11185
PASS document.querySelector(":nth-child(even empty .class)") threw exception SyntaxError: The string did not match the expected pattern..

LayoutTests/fast/css/parsing-css-nth-child-of-3.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
for (var i = 0; i < validNthAnPlusB.length; ++i) {
4242
testInvalidSelector(validNthAnPlusB[i] + " of");
4343
testInvalidSelector(validNthAnPlusB[i] + " of ");
44-
testInvalidSelector(validNthAnPlusB[i] + " of.class");
4544
testInvalidSelector(validNthAnPlusB[i] + "of .class");
4645
}
4746

0 commit comments

Comments
 (0)