OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/parser/CSSSelectorParser.h" | 5 #include "core/css/parser/CSSSelectorParser.h" |
6 | 6 |
7 #include "core/css/CSSSelectorList.h" | 7 #include "core/css/CSSSelectorList.h" |
8 #include "core/css/StyleSheetContents.h" | 8 #include "core/css/StyleSheetContents.h" |
9 #include "core/frame/UseCounter.h" | 9 #include "core/frame/UseCounter.h" |
10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 compoundPseudoElement = simpleSelector->pseudoType(); | 297 compoundPseudoElement = simpleSelector->pseudoType(); |
298 | 298 |
299 if (compoundSelector) | 299 if (compoundSelector) |
300 compoundSelector = addSimpleSelectorToCompound(compoundSelector.rele
ase(), simpleSelector.release()); | 300 compoundSelector = addSimpleSelectorToCompound(compoundSelector.rele
ase(), simpleSelector.release()); |
301 else | 301 else |
302 compoundSelector = simpleSelector.release(); | 302 compoundSelector = simpleSelector.release(); |
303 } | 303 } |
304 | 304 |
305 if (!compoundSelector) { | 305 if (!compoundSelector) { |
306 AtomicString namespaceURI = determineNamespace(namespacePrefix); | 306 AtomicString namespaceURI = determineNamespace(namespacePrefix); |
307 if (namespaceURI.isNull()) | 307 if (namespaceURI.isNull()) { |
| 308 m_failedParsing = true; |
308 return nullptr; | 309 return nullptr; |
| 310 } |
309 return CSSParserSelector::create(QualifiedName(namespacePrefix, elementN
ame, namespaceURI)); | 311 return CSSParserSelector::create(QualifiedName(namespacePrefix, elementN
ame, namespaceURI)); |
310 } | 312 } |
311 prependTypeSelectorIfNeeded(namespacePrefix, elementName, compoundSelector.g
et()); | 313 prependTypeSelectorIfNeeded(namespacePrefix, elementName, compoundSelector.g
et()); |
312 return splitCompoundAtImplicitShadowCrossingCombinator(compoundSelector.rele
ase()); | 314 return splitCompoundAtImplicitShadowCrossingCombinator(compoundSelector.rele
ase()); |
313 } | 315 } |
314 | 316 |
315 PassOwnPtr<CSSParserSelector> CSSSelectorParser::consumeSimpleSelector(CSSParser
TokenRange& range) | 317 PassOwnPtr<CSSParserSelector> CSSSelectorParser::consumeSimpleSelector(CSSParser
TokenRange& range) |
316 { | 318 { |
317 const CSSParserToken& token = range.peek(); | 319 const CSSParserToken& token = range.peek(); |
318 OwnPtr<CSSParserSelector> selector; | 320 OwnPtr<CSSParserSelector> selector; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 | 765 |
764 if (!splitAfter || !splitAfter->tagHistory()) | 766 if (!splitAfter || !splitAfter->tagHistory()) |
765 return compoundSelector; | 767 return compoundSelector; |
766 | 768 |
767 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory(); | 769 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory(); |
768 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector
::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, compoundS
elector); | 770 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector
::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, compoundS
elector); |
769 return secondCompound.release(); | 771 return secondCompound.release(); |
770 } | 772 } |
771 | 773 |
772 } // namespace blink | 774 } // namespace blink |
OLD | NEW |