Changeset 288111 in webkit
- Timestamp:
- Jan 17, 2022 11:57:43 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/parser/CSSSelectorParser.cpp (modified) (3 diffs)
-
Source/WebCore/css/parser/CSSSelectorParser.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r288107 r288111 1 2022-01-17 Antti Koivisto <antti@apple.com> 2 3 [:has() pseudo-class] Disallow nested :has() 4 https://bugs.webkit.org/show_bug.cgi?id=235231 5 6 Reviewed by Dean Jackson. 7 8 * web-platform-tests/css/selectors/has-argument-with-explicit-scope.tentative-expected.txt: 9 * web-platform-tests/css/selectors/has-basic-expected.txt: 10 * web-platform-tests/css/selectors/parsing/parse-has-expected.txt: 11 1 12 2022-01-17 Myles C. Maxfield <mmaxfield@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic-expected.txt
r285921 r288111 10 10 PASS .parent:has(:is(.target ~ .sibling .descendant)) matches expected elements 11 11 PASS .sibling:has(.descendant) ~ .target matches expected elements 12 PASS :has(.sibling:has(.descendant) ~ .target) matches expected elements 13 PASS :has(.sibling:has(.descendant) ~ .target) ~ .parent > .descendant matches expected elements 12 FAIL :has(.sibling:has(.descendant) ~ .target) matches expected elements The string did not match the expected pattern. 13 FAIL :has(.sibling:has(.descendant) ~ .target) ~ .parent > .descendant matches expected elements The string did not match the expected pattern. 14 14 PASS :has(> .parent) matches expected elements 15 15 PASS :has(> .target) matches expected elements -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument-expected.txt
r285921 r288111 33 33 PASS .y:has(> .g .h) .i matches expected elements 34 34 PASS .y:has(.g .h) .i matches expected elements 35 PASS .x:has(+ .y:has(> .g .h) .i) matches expected elements 36 PASS .x:has(+ .y:has(.g .h) .i) matches expected elements 37 PASS .x:has(+ .y:has(> .g .h) .i) ~ .j matches expected elements 38 PASS .x:has(+ .y:has(.g .h) .i) ~ .j matches expected elements 39 PASS .x:has(~ .y:has(> .g .h) .i) matches expected elements 40 PASS .x:has(~ .y:has(.g .h) .i) matches expected elements 35 FAIL .x:has(+ .y:has(> .g .h) .i) matches expected elements The string did not match the expected pattern. 36 FAIL .x:has(+ .y:has(.g .h) .i) matches expected elements The string did not match the expected pattern. 37 FAIL .x:has(+ .y:has(> .g .h) .i) ~ .j matches expected elements The string did not match the expected pattern. 38 FAIL .x:has(+ .y:has(.g .h) .i) ~ .j matches expected elements The string did not match the expected pattern. 39 FAIL .x:has(~ .y:has(> .g .h) .i) matches expected elements The string did not match the expected pattern. 40 FAIL .x:has(~ .y:has(.g .h) .i) matches expected elements The string did not match the expected pattern. 41 41 PASS .d .x:has(.e) matches expected elements 42 42 PASS .d ~ .x:has(~ .e) matches expected elements -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has-expected.txt
r285921 r288111 16 16 PASS ".a .b:has(.c .d)" should be a valid selector 17 17 PASS ".a .b:has(.c .d) .e" should be a valid selector 18 PASS ".a:has(.b:has(.c))" should be a valid selector 18 FAIL ".a:has(.b:has(.c))" should be a valid selector The string did not match the expected pattern. 19 19 PASS ".a:has(.b:is(.c .d))" should be a valid selector 20 PASS ".a:has(.b:is(.c:has(.d) .e))" should be a valid selector 20 FAIL ".a:has(.b:is(.c:has(.d) .e))" should be a valid selector assert_equals: serialization should be canonical expected ".a:has(.b:is(.c:has(.d) .e))" but got ".a:has(.b:is())" 21 21 PASS ".a:is(.b:has(.c) .d)" should be a valid selector 22 22 PASS ".a:not(:has(.b))" should be a valid selector -
trunk/Source/WebCore/ChangeLog
r288110 r288111 1 2022-01-17 Antti Koivisto <antti@apple.com> 2 3 [:has() pseudo-class] Disallow nested :has() 4 https://bugs.webkit.org/show_bug.cgi?id=235231 5 6 Reviewed by Dean Jackson. 7 8 Nested case ':has(:has(foo))' adds no meaningful capability and would complicate invalidation. 9 See https://github.com/w3c/csswg-drafts/issues/6952 for more details. 10 11 * css/parser/CSSSelectorParser.cpp: 12 (WebCore::CSSSelectorParser::consumePseudo): 13 14 Also set m_resistDefaultNamespace like other logical combination pseudo-classes. 15 16 * css/parser/CSSSelectorParser.h: 17 1 18 2022-01-17 Youenn Fablet <youenn@apple.com> 2 19 -
trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp
r287222 r288111 687 687 switch (selector->pseudoClassType()) { 688 688 case CSSSelector::PseudoClassNot: { 689 SetForScope <bool>resistDefaultNamespace(m_resistDefaultNamespace, true);689 SetForScope resistDefaultNamespace(m_resistDefaultNamespace, true); 690 690 auto selectorList = makeUnique<CSSSelectorList>(); 691 691 *selectorList = consumeComplexSelectorList(block); … … 735 735 case CSSSelector::PseudoClassMatches: 736 736 case CSSSelector::PseudoClassAny: { 737 SetForScope <bool>resistDefaultNamespace(m_resistDefaultNamespace, true);737 SetForScope resistDefaultNamespace(m_resistDefaultNamespace, true); 738 738 auto selectorList = makeUnique<CSSSelectorList>(); 739 739 *selectorList = consumeForgivingComplexSelectorList(block); … … 752 752 } 753 753 case CSSSelector::PseudoClassHas: { 754 if (m_disallowHasPseudoClass) 755 return nullptr; 756 SetForScope resistDefaultNamespace(m_resistDefaultNamespace, true); 757 SetForScope disallowNestedHas(m_disallowHasPseudoClass, true); 754 758 auto selectorList = makeUnique<CSSSelectorList>(); 755 759 *selectorList = consumeForgivingRelativeSelectorList(block); -
trunk/Source/WebCore/css/parser/CSSSelectorParser.h
r285054 r288111 90 90 bool m_failedParsing { false }; 91 91 bool m_disallowPseudoElements { false }; 92 bool m_disallowHasPseudoClass { false }; 92 93 bool m_resistDefaultNamespace { false }; 93 94 bool m_ignoreDefaultNamespace { false };
Note: See TracChangeset
for help on using the changeset viewer.