Changeset 204591 in webkit
- Timestamp:
- Aug 17, 2016, 11:22:40 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 15 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/css-selector-text-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/css/css-selector-text.html (modified) (2 diffs)
-
LayoutTests/fast/css/css-set-selector-text-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/css/css-set-selector-text.html (modified) (2 diffs)
-
LayoutTests/fast/selectors/empty-namespace-with-element-selector-expected.txt (added)
-
LayoutTests/fast/selectors/empty-namespace-with-element-selector.html (added)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt (modified) (4 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt (modified) (4 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSGrammar.y.in (modified) (2 diffs)
-
Source/WebCore/css/CSSParser.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSParser.h (modified) (1 diff)
-
Source/WebCore/css/CSSSelector.cpp (modified) (1 diff)
-
Source/WebCore/css/CSSSelectorList.cpp (modified) (1 diff)
-
Source/WebCore/css/StyleSheetContents.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r204563 r204591 1 2016-08-17 Benjamin Poulain <benjamin@webkit.org> 2 3 [CSS] The parser should not get rid of empty namespace specification in front of element name selectors 4 https://bugs.webkit.org/show_bug.cgi?id=160936 5 6 Reviewed by Chris Dumez. 7 8 * fast/css/css-selector-text-expected.txt: 9 * fast/css/css-selector-text.html: 10 * fast/css/css-set-selector-text-expected.txt: 11 * fast/css/css-set-selector-text.html: 12 * fast/selectors/empty-namespace-with-element-selector-expected.txt: Added. 13 * fast/selectors/empty-namespace-with-element-selector.html: Added. 14 1 15 2016-08-17 Chris Fleizach <cfleizach@apple.com> 2 16 -
trunk/LayoutTests/fast/css/css-selector-text-expected.txt
r202358 r204591 27 27 PASS parseThenSerializeRule('*|* { }') is '*|* { }' 28 28 PASS parseThenSerializeRule('n|* { }') is 'n|* { }' 29 PASS parseThenSerializeRule('|a { }') is '|a { }' 30 PASS parseThenSerializeRule('|* { }') is '|* { }' 29 31 PASS parseThenSerializeRule('[*|a] { }') is '[*|a] { }' 30 32 PASS parseThenSerializeRule('[n|a] { }') is '[n|a] { }' 33 PASS parseThenSerializeRule('[|a] { }') is '[a] { }' 31 34 32 35 PASS parseThenSerializeRule('a:active { }') is 'a:active { }' … … 254 257 255 258 PASS parseThenSerializeRule('*:active { }') is ':active { }' 256 PASS parseThenSerializeRule('|a { }') is 'a { }'257 259 258 260 PASS parseThenSerializeRule('input[type=file]:focus { }') is 'input[type="file"]:focus { }' -
trunk/LayoutTests/fast/css/css-selector-text.html
r202358 r204591 78 78 testSelectorRoundTrip('*|*'); 79 79 testSelectorRoundTrip('n|*'); 80 testSelectorRoundTrip('|a'); 81 testSelectorRoundTrip('|*'); 80 82 testSelectorRoundTrip('[*|a]'); 81 83 testSelectorRoundTrip('[n|a]'); 84 shouldBe("parseThenSerializeRule('[|a] { }')", "'[a] { }'"); 82 85 83 86 debug(''); … … 355 358 356 359 shouldBe("parseThenSerializeRule('*:active { }')", "':active { }'"); 357 shouldBe("parseThenSerializeRule('|a { }')", "'a { }'");358 360 359 361 debug(''); -
trunk/LayoutTests/fast/css/css-set-selector-text-expected.txt
r202358 r204591 39 39 PASS setThenReadSelectorText('[*|a]') is '[*|a]' 40 40 PASS setThenReadSelectorText('[n|a]') is '[n|a]' 41 PASS setThenReadSelectorText('|*') is '|*' 42 PASS setThenReadSelectorText('[*|a]') is '[*|a]' 43 PASS setThenReadSelectorText('[n|a]') is '[n|a]' 44 PASS setThenReadSelectorText('[|a]') is '[a]' 41 45 42 46 PASS setThenReadSelectorText('a:active') is 'a:active' … … 249 253 250 254 PASS setThenReadSelectorText('*:active') is ':active' 251 PASS setThenReadSelectorText('|a') is 'a'252 255 253 256 PASS setThenReadSelectorText('input[type=file]:focus') is 'input[type="file"]:focus' -
trunk/LayoutTests/fast/css/css-set-selector-text.html
r202358 r204591 97 97 testSelectorRoundTrip('[*|a]'); 98 98 testSelectorRoundTrip('[n|a]'); 99 testSelectorRoundTrip('|*'); 100 testSelectorRoundTrip('[*|a]'); 101 testSelectorRoundTrip('[n|a]'); 102 shouldBe("setThenReadSelectorText('[|a]')", "'[a]'"); 99 103 100 104 debug(''); … … 352 356 353 357 shouldBe("setThenReadSelectorText('*:active')", "':active'"); 354 shouldBe("setThenReadSelectorText('|a')", "'a'");355 358 356 359 debug(''); -
trunk/LayoutTests/imported/w3c/ChangeLog
r204543 r204591 1 2016-08-17 Benjamin Poulain <benjamin@webkit.org> 2 3 [CSS] The parser should not get rid of empty namespace specification in front of element name selectors 4 https://bugs.webkit.org/show_bug.cgi?id=160936 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt: 9 * web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt: 10 1 11 2016-08-16 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt
r204522 r204591 604 604 PASS Document.querySelectorAll: Namespace selector, matching element with any namespace: #any-namespace *|div 605 605 PASS Document.querySelector: Namespace selector, matching element with any namespace: #any-namespace *|div 606 FAIL Document.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the expected number of matches. expected 1 but got 4 607 FAIL Document.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 608 FAIL Document.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the expected number of matches. expected 1 but got 4 609 FAIL Document.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 606 PASS Document.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div 607 PASS Document.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div 608 PASS Document.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* 609 PASS Document.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* 610 610 PASS Document.querySelectorAll: Descendant combinator, matching element that is a descendant of an element with id: #descendant div 611 611 PASS Document.querySelector: Descendant combinator, matching element that is a descendant of an element with id: #descendant div … … 1022 1022 PASS Detached Element.querySelectorAll: Namespace selector, matching element with any namespace: #any-namespace *|div 1023 1023 PASS Detached Element.querySelector: Namespace selector, matching element with any namespace: #any-namespace *|div 1024 FAIL Detached Element.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the expected number of matches. expected 1 but got 4 1025 FAIL Detached Element.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1026 FAIL Detached Element.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the expected number of matches. expected 1 but got 4 1027 FAIL Detached Element.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1024 PASS Detached Element.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1025 PASS Detached Element.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1026 PASS Detached Element.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1027 PASS Detached Element.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1028 1028 PASS Detached Element.querySelectorAll: Descendant combinator, matching element that is a descendant of an element with id: #descendant div 1029 1029 PASS Detached Element.querySelector: Descendant combinator, matching element that is a descendant of an element with id: #descendant div … … 1438 1438 PASS Fragment.querySelectorAll: Namespace selector, matching element with any namespace: #any-namespace *|div 1439 1439 PASS Fragment.querySelector: Namespace selector, matching element with any namespace: #any-namespace *|div 1440 FAIL Fragment.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the expected number of matches. expected 1 but got 4 1441 FAIL Fragment.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1442 FAIL Fragment.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the expected number of matches. expected 1 but got 4 1443 FAIL Fragment.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1440 PASS Fragment.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1441 PASS Fragment.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1442 PASS Fragment.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1443 PASS Fragment.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1444 1444 PASS Fragment.querySelectorAll: Descendant combinator, matching element that is a descendant of an element with id: #descendant div 1445 1445 PASS Fragment.querySelector: Descendant combinator, matching element that is a descendant of an element with id: #descendant div … … 1854 1854 PASS In-document Element.querySelectorAll: Namespace selector, matching element with any namespace: #any-namespace *|div 1855 1855 PASS In-document Element.querySelector: Namespace selector, matching element with any namespace: #any-namespace *|div 1856 FAIL In-document Element.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the expected number of matches. expected 1 but got 4 1857 FAIL In-document Element.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1858 FAIL In-document Element.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the expected number of matches. expected 1 but got 4 1859 FAIL In-document Element.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1856 PASS In-document Element.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1857 PASS In-document Element.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1858 PASS In-document Element.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1859 PASS In-document Element.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1860 1860 PASS In-document Element.querySelectorAll: Descendant combinator, matching element that is a descendant of an element with id: #descendant div 1861 1861 PASS In-document Element.querySelector: Descendant combinator, matching element that is a descendant of an element with id: #descendant div -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt
r204522 r204591 604 604 PASS Document.querySelectorAll: Namespace selector, matching element with any namespace: #any-namespace *|div 605 605 PASS Document.querySelector: Namespace selector, matching element with any namespace: #any-namespace *|div 606 FAIL Document.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the expected number of matches. expected 1 but got 4 607 FAIL Document.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 608 FAIL Document.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the expected number of matches. expected 1 but got 4 609 FAIL Document.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 606 PASS Document.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div 607 PASS Document.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div 608 PASS Document.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* 609 PASS Document.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* 610 610 PASS Document.querySelectorAll: Descendant combinator, matching element that is a descendant of an element with id: #descendant div 611 611 PASS Document.querySelector: Descendant combinator, matching element that is a descendant of an element with id: #descendant div … … 1022 1022 PASS Detached Element.querySelectorAll: Namespace selector, matching element with any namespace: #any-namespace *|div 1023 1023 PASS Detached Element.querySelector: Namespace selector, matching element with any namespace: #any-namespace *|div 1024 FAIL Detached Element.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the expected number of matches. expected 1 but got 4 1025 FAIL Detached Element.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1026 FAIL Detached Element.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the expected number of matches. expected 1 but got 4 1027 FAIL Detached Element.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1024 PASS Detached Element.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1025 PASS Detached Element.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1026 PASS Detached Element.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1027 PASS Detached Element.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1028 1028 PASS Detached Element.querySelectorAll: Descendant combinator, matching element that is a descendant of an element with id: #descendant div 1029 1029 PASS Detached Element.querySelector: Descendant combinator, matching element that is a descendant of an element with id: #descendant div … … 1438 1438 PASS Fragment.querySelectorAll: Namespace selector, matching element with any namespace: #any-namespace *|div 1439 1439 PASS Fragment.querySelector: Namespace selector, matching element with any namespace: #any-namespace *|div 1440 FAIL Fragment.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the expected number of matches. expected 1 but got 4 1441 FAIL Fragment.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1442 FAIL Fragment.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the expected number of matches. expected 1 but got 4 1443 FAIL Fragment.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1440 PASS Fragment.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1441 PASS Fragment.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1442 PASS Fragment.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1443 PASS Fragment.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1444 1444 PASS Fragment.querySelectorAll: Descendant combinator, matching element that is a descendant of an element with id: #descendant div 1445 1445 PASS Fragment.querySelector: Descendant combinator, matching element that is a descendant of an element with id: #descendant div … … 1854 1854 PASS In-document Element.querySelectorAll: Namespace selector, matching element with any namespace: #any-namespace *|div 1855 1855 PASS In-document Element.querySelector: Namespace selector, matching element with any namespace: #any-namespace *|div 1856 FAIL In-document Element.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the expected number of matches. expected 1 but got 4 1857 FAIL In-document Element.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1858 FAIL In-document Element.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the expected number of matches. expected 1 but got 4 1859 FAIL In-document Element.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* assert_equals: The method should return the first match. expected "no-namespace-div3" but got "no-namespace-div1" 1856 PASS In-document Element.querySelectorAll: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1857 PASS In-document Element.querySelector: Namespace selector, matching div elements in no namespace only: #no-namespace |div 1858 PASS In-document Element.querySelectorAll: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1859 PASS In-document Element.querySelector: Namespace selector, matching any elements in no namespace only: #no-namespace |* 1860 1860 PASS In-document Element.querySelectorAll: Descendant combinator, matching element that is a descendant of an element with id: #descendant div 1861 1861 PASS In-document Element.querySelector: Descendant combinator, matching element that is a descendant of an element with id: #descendant div -
trunk/Source/WebCore/ChangeLog
r204589 r204591 1 2016-08-17 Benjamin Poulain <benjamin@webkit.org> 2 3 [CSS] The parser should not get rid of empty namespace specification in front of element name selectors 4 https://bugs.webkit.org/show_bug.cgi?id=160936 5 6 Reviewed by Chris Dumez. 7 8 There are two places where you can specify an empty namespace 9 in selectors: 10 - Element name (e.g. "|name") 11 - Attribute name (e.g. "[|name]") 12 In the first case, if we have an empty namespace, the selector 13 should match that. 14 In the second case, the default namespace of attribute is already 15 empty so it is just the same as "[name]". 16 17 Our code was just discarding any empty namespace. This is fine 18 for attributes but for names that is transforming "|name" into "name" 19 which is invalid. 20 21 This patch updates those cases to differentiate: 22 - Null prefix -> There was no namespace specified. 23 - Empty prefix -> There was a namespace prefix and it is empty. 24 25 Test: fast/selectors/empty-namespace-with-element-selector.html 26 27 * css/CSSGrammar.y.in: 28 * css/CSSParser.cpp: 29 (WebCore::CSSParser::determineNameInNamespace): 30 (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded): 31 (WebCore::CSSParser::rewriteSpecifiersWithElementName): 32 * css/CSSParser.h: 33 * css/CSSSelector.cpp: 34 (WebCore::CSSSelector::selectorText): 35 * css/CSSSelectorList.cpp: 36 (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()): 37 * css/StyleSheetContents.cpp: 38 (WebCore::StyleSheetContents::determineNamespace): Deleted. 39 1 40 2016-08-17 Chris Dumez <cdumez@apple.com> 2 41 -
trunk/Source/WebCore/css/CSSGrammar.y.in
r203269 r204591 1166 1166 1167 1167 namespace_selector: 1168 '|' { $$.clear(); } 1168 '|' { 1169 static LChar emptyString = '\0'; 1170 $$.init(&emptyString, 0); 1171 } 1169 1172 | '*' '|' { static LChar star = '*'; $$.init(&star, 1); } 1170 1173 | IDENT '|' … … 1177 1180 | element_name specifier_list { 1178 1181 $$ = $2; 1179 if ($$) 1180 parser->rewriteSpecifiersWithElementName(nullAtom, $1, *$$); 1182 if ($$) { 1183 QualifiedName elementName(nullAtom, $1, parser->m_defaultNamespace); 1184 parser->rewriteSpecifiersWithElementName(elementName, *$$); 1185 } 1181 1186 } 1182 1187 | specifier_list { -
trunk/Source/WebCore/css/CSSParser.cpp
r204566 r204591 13090 13090 QualifiedName CSSParser::determineNameInNamespace(const AtomicString& prefix, const AtomicString& localName) 13091 13091 { 13092 if (prefix.isNull()) 13093 return QualifiedName(nullAtom, localName, nullAtom); // No namespace. If an element/attribute has a namespace, we won't match it. 13094 if (prefix.isEmpty()) 13095 return QualifiedName(emptyAtom, localName, emptyAtom); // Empty namespace. 13096 if (prefix == starAtom) 13097 return QualifiedName(prefix, localName, starAtom); // We'll match any namespace. 13098 13092 13099 if (!m_styleSheet) 13093 13100 return QualifiedName(prefix, localName, m_defaultNamespace); … … 13097 13104 void CSSParser::rewriteSpecifiersWithNamespaceIfNeeded(CSSParserSelector& specifiers) 13098 13105 { 13099 if (m_defaultNamespace != starAtom || specifiers.isCustomPseudoElement()) 13100 rewriteSpecifiersWithElementName(nullAtom, starAtom, specifiers, /*tagIsForNamespaceRule*/true); 13101 } 13102 13103 void CSSParser::rewriteSpecifiersWithElementName(const AtomicString& namespacePrefix, const AtomicString& elementName, CSSParserSelector& specifiers, bool tagIsForNamespaceRule) 13104 { 13105 AtomicString determinedNamespace = namespacePrefix != nullAtom && m_styleSheet ? m_styleSheet->determineNamespace(namespacePrefix) : m_defaultNamespace; 13106 QualifiedName tag(namespacePrefix, elementName, determinedNamespace); 13107 13106 if (m_defaultNamespace != starAtom || specifiers.isCustomPseudoElement()) { 13107 QualifiedName elementName(nullAtom, starAtom, m_defaultNamespace); 13108 rewriteSpecifiersWithElementName(elementName, specifiers, /*tagIsForNamespaceRule*/true); 13109 } 13110 } 13111 13112 void CSSParser::rewriteSpecifiersWithElementName(const AtomicString& namespacePrefix, const AtomicString& elementName, CSSParserSelector& specifiers) 13113 { 13114 QualifiedName tag(determineNameInNamespace(namespacePrefix, elementName)); 13115 rewriteSpecifiersWithElementName(tag, specifiers, false); 13116 } 13117 13118 void CSSParser::rewriteSpecifiersWithElementName(const QualifiedName& tag, CSSParserSelector& specifiers, bool tagIsForNamespaceRule) 13119 { 13108 13120 if (!specifiers.isCustomPseudoElement()) { 13109 13121 if (tag == anyQName()) -
trunk/Source/WebCore/css/CSSParser.h
r204566 r204591 404 404 QualifiedName determineNameInNamespace(const AtomicString& prefix, const AtomicString& localName); 405 405 406 void rewriteSpecifiersWithElementName(const AtomicString& namespacePrefix, const AtomicString& elementName, CSSParserSelector&, bool isNamespacePlaceholder = false); 406 void rewriteSpecifiersWithElementName(const AtomicString& namespacePrefix, const AtomicString& elementName, CSSParserSelector&); 407 void rewriteSpecifiersWithElementName(const QualifiedName& tagName, CSSParserSelector&, bool isNamespacePlaceholder = false); 407 408 void rewriteSpecifiersWithNamespaceIfNeeded(CSSParserSelector&); 408 409 std::unique_ptr<CSSParserSelector> rewriteSpecifiers(std::unique_ptr<CSSParserSelector>, std::unique_ptr<CSSParserSelector>); -
trunk/Source/WebCore/css/CSSSelector.cpp
r204466 r204591 669 669 str.append('['); 670 670 const AtomicString& prefix = cs->attribute().prefix(); 671 if (!prefix.is Null()) {671 if (!prefix.isEmpty()) { 672 672 str.append(prefix); 673 673 str.append('|'); -
trunk/Source/WebCore/css/CSSSelectorList.cpp
r195304 r204591 174 174 bool operator()(const CSSSelector* selector) 175 175 { 176 if (selector->match() == CSSSelector::Tag && selector->tagQName().prefix() != nullAtom&& selector->tagQName().prefix() != starAtom)177 return true; 178 if (selector->isAttributeSelector() && selector->attribute().prefix() != nullAtom&& selector->attribute().prefix() != starAtom)176 if (selector->match() == CSSSelector::Tag && !selector->tagQName().prefix().isEmpty() && selector->tagQName().prefix() != starAtom) 177 return true; 178 if (selector->isAttributeSelector() && !selector->attribute().prefix().isEmpty() && selector->attribute().prefix() != starAtom) 179 179 return true; 180 180 return false; -
trunk/Source/WebCore/css/StyleSheetContents.cpp
r201441 r204591 280 280 const AtomicString& StyleSheetContents::determineNamespace(const AtomicString& prefix) 281 281 { 282 if (prefix.isNull())283 return nullAtom; // No namespace. If an element/attribute has a namespace, we won't match it.284 if (prefix == starAtom)285 return starAtom; // We'll match any namespace.286 282 PrefixNamespaceURIMap::const_iterator it = m_namespaces.find(prefix); 287 283 if (it == m_namespaces.end())
Note:
See TracChangeset
for help on using the changeset viewer.