| 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 #ifndef CSSSelectorParser_h | 5 #ifndef CSSSelectorParser_h |
| 6 #define CSSSelectorParser_h | 6 #define CSSSelectorParser_h |
| 7 | 7 |
| 8 #include "core/css/parser/CSSParserTokenRange.h" | 8 #include "core/css/parser/CSSParserTokenRange.h" |
| 9 #include "core/css/parser/CSSParserValues.h" | 9 #include "core/css/parser/CSSParserValues.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class CSSSelectorList; | 13 class CSSSelectorList; |
| 14 class StyleSheetContents; | 14 class StyleSheetContents; |
| 15 | 15 |
| 16 // FIXME: We should consider building CSSSelectors directly instead of using | 16 // FIXME: We should consider building CSSSelectors directly instead of using |
| 17 // the intermediate CSSParserSelector. | 17 // the intermediate CSSParserSelector. |
| 18 class CSSSelectorParser { | 18 class CSSSelectorParser { |
| 19 public: | 19 public: |
| 20 static void parseSelector(CSSParserTokenRange, const CSSParserContext&, CSSS
electorList&); | 20 static void parseSelector(CSSParserTokenRange, const CSSParserContext&, CSSS
electorList&); |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 CSSSelectorParser(CSSParserTokenRange, const CSSParserContext&); | 23 CSSSelectorParser(CSSParserTokenRange, const CSSParserContext&); |
| 24 | 24 |
| 25 // These will all consume trailing comments if successful | 25 // These will all consume trailing comments if successful |
| 26 | 26 |
| 27 void consumeComplexSelectorList(CSSSelectorList&); | 27 void consumeComplexSelectorList(CSSSelectorList&); |
| 28 void consumeCompoundSelectorList(CSSSelectorList&); |
| 28 | 29 |
| 29 PassOwnPtr<CSSParserSelector> consumeComplexSelector(); | 30 PassOwnPtr<CSSParserSelector> consumeComplexSelector(); |
| 30 PassOwnPtr<CSSParserSelector> consumeCompoundSelector(); | 31 PassOwnPtr<CSSParserSelector> consumeCompoundSelector(); |
| 31 // This doesn't include element names, since they're handled specially | 32 // This doesn't include element names, since they're handled specially |
| 32 PassOwnPtr<CSSParserSelector> consumeSimpleSelector(); | 33 PassOwnPtr<CSSParserSelector> consumeSimpleSelector(); |
| 33 | 34 |
| 34 bool consumeName(AtomicString& name, AtomicString& namespacePrefix, bool& ha
sNamespace); | 35 bool consumeName(AtomicString& name, AtomicString& namespacePrefix, bool& ha
sNamespace); |
| 35 | 36 |
| 36 // These will return nullptr when the selector is invalid | 37 // These will return nullptr when the selector is invalid |
| 37 PassOwnPtr<CSSParserSelector> consumeId(); | 38 PassOwnPtr<CSSParserSelector> consumeId(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 55 const CSSParserContext& m_context; | 56 const CSSParserContext& m_context; |
| 56 AtomicString m_defaultNamespace; | 57 AtomicString m_defaultNamespace; |
| 57 StyleSheetContents* m_styleSheet; | 58 StyleSheetContents* m_styleSheet; |
| 58 | 59 |
| 59 bool m_failedParsing; | 60 bool m_failedParsing; |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace | 63 } // namespace |
| 63 | 64 |
| 64 #endif // CSSSelectorParser_h | 65 #endif // CSSSelectorParser_h |
| OLD | NEW |