Changeset 288512 in webkit
- Timestamp:
- Jan 24, 2022, 5:55:41 PM (5 years ago)
- Location:
- branches/safari-613-branch
- 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
-
branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog
r288511 r288512 1 2022-01-24 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r288111. rdar://problem/87699260 4 5 [:has() pseudo-class] Disallow nested :has() 6 https://bugs.webkit.org/show_bug.cgi?id=235231 7 8 Reviewed by Dean Jackson. 9 10 LayoutTests/imported/w3c: 11 12 * web-platform-tests/css/selectors/has-argument-with-explicit-scope.tentative-expected.txt: 13 * web-platform-tests/css/selectors/has-basic-expected.txt: 14 * web-platform-tests/css/selectors/parsing/parse-has-expected.txt: 15 16 Source/WebCore: 17 18 Nested case ':has(:has(foo))' adds no meaningful capability and would complicate invalidation. 19 See https://github.com/w3c/csswg-drafts/issues/6952 for more details. 20 21 * css/parser/CSSSelectorParser.cpp: 22 (WebCore::CSSSelectorParser::consumePseudo): 23 24 Also set m_resistDefaultNamespace like other logical combination pseudo-classes. 25 26 * css/parser/CSSSelectorParser.h: 27 28 29 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288111 268f45cc-cd09-0410-ab3c-d52691b4dbfc 30 31 2022-01-17 Antti Koivisto <antti@apple.com> 32 33 [:has() pseudo-class] Disallow nested :has() 34 https://bugs.webkit.org/show_bug.cgi?id=235231 35 36 Reviewed by Dean Jackson. 37 38 * web-platform-tests/css/selectors/has-argument-with-explicit-scope.tentative-expected.txt: 39 * web-platform-tests/css/selectors/has-basic-expected.txt: 40 * web-platform-tests/css/selectors/parsing/parse-has-expected.txt: 41 1 42 2022-01-24 Alan Coon <alancoon@apple.com> 2 43 -
branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-basic-expected.txt
r285921 r288512 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 -
branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-relative-argument-expected.txt
r285921 r288512 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 -
branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has-expected.txt
r285921 r288512 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 -
branches/safari-613-branch/Source/WebCore/ChangeLog
r288511 r288512 1 2022-01-24 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r288111. rdar://problem/87699260 4 5 [:has() pseudo-class] Disallow nested :has() 6 https://bugs.webkit.org/show_bug.cgi?id=235231 7 8 Reviewed by Dean Jackson. 9 10 LayoutTests/imported/w3c: 11 12 * web-platform-tests/css/selectors/has-argument-with-explicit-scope.tentative-expected.txt: 13 * web-platform-tests/css/selectors/has-basic-expected.txt: 14 * web-platform-tests/css/selectors/parsing/parse-has-expected.txt: 15 16 Source/WebCore: 17 18 Nested case ':has(:has(foo))' adds no meaningful capability and would complicate invalidation. 19 See https://github.com/w3c/csswg-drafts/issues/6952 for more details. 20 21 * css/parser/CSSSelectorParser.cpp: 22 (WebCore::CSSSelectorParser::consumePseudo): 23 24 Also set m_resistDefaultNamespace like other logical combination pseudo-classes. 25 26 * css/parser/CSSSelectorParser.h: 27 28 29 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288111 268f45cc-cd09-0410-ab3c-d52691b4dbfc 30 31 2022-01-17 Antti Koivisto <antti@apple.com> 32 33 [:has() pseudo-class] Disallow nested :has() 34 https://bugs.webkit.org/show_bug.cgi?id=235231 35 36 Reviewed by Dean Jackson. 37 38 Nested case ':has(:has(foo))' adds no meaningful capability and would complicate invalidation. 39 See https://github.com/w3c/csswg-drafts/issues/6952 for more details. 40 41 * css/parser/CSSSelectorParser.cpp: 42 (WebCore::CSSSelectorParser::consumePseudo): 43 44 Also set m_resistDefaultNamespace like other logical combination pseudo-classes. 45 46 * css/parser/CSSSelectorParser.h: 47 1 48 2022-01-24 Alan Coon <alancoon@apple.com> 2 49 -
branches/safari-613-branch/Source/WebCore/css/parser/CSSSelectorParser.cpp
r287222 r288512 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); -
branches/safari-613-branch/Source/WebCore/css/parser/CSSSelectorParser.h
r285054 r288512 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.