| 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/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/css/parser/CSSParserTokenRange.h" | 9 #include "core/css/parser/CSSParserTokenRange.h" |
| 10 #include "core/css/parser/CSSParserValues.h" | 10 #include "core/css/parser/CSSParserValues.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class CSSSelectorList; | 14 class CSSSelectorList; |
| 15 class StyleSheetContents; | 15 class StyleSheetContents; |
| 16 | 16 |
| 17 // FIXME: We should consider building CSSSelectors directly instead of using | 17 // FIXME: We should consider building CSSSelectors directly instead of using |
| 18 // the intermediate CSSParserSelector. | 18 // the intermediate CSSParserSelector. |
| 19 class CORE_EXPORT CSSSelectorParser { | 19 class CORE_EXPORT CSSSelectorParser { |
| 20 public: | 20 public: |
| 21 static void parseSelector(CSSParserTokenRange, const CSSParserContext&, cons
t AtomicString& defaultNamespace, StyleSheetContents*, CSSSelectorList&); | 21 static void parseSelector(CSSParserTokenRange, const CSSParserContext&, cons
t AtomicString& defaultNamespace, StyleSheetContents*, CSSSelectorList&); |
| 22 | 22 |
| 23 static bool consumeANPlusB(CSSParserTokenRange&, std::pair<int, int>&); | 23 static bool consumeANPlusB(CSSParserTokenRange&, std::pair<int, int>&); |
| 24 | 24 |
| 25 // FIXME: This shouldn't be in the header once the Bison parser is removed | |
| 26 static void recordSelectorStats(const CSSParserContext&, const CSSSelectorLi
st&); | |
| 27 | |
| 28 private: | 25 private: |
| 29 CSSSelectorParser(const CSSParserContext&, const AtomicString& defaultNamesp
ace, StyleSheetContents*); | 26 CSSSelectorParser(const CSSParserContext&, const AtomicString& defaultNamesp
ace, StyleSheetContents*); |
| 30 | 27 |
| 31 // These will all consume trailing comments if successful | 28 // These will all consume trailing comments if successful |
| 32 | 29 |
| 33 void consumeComplexSelectorList(CSSParserTokenRange&, CSSSelectorList&); | 30 void consumeComplexSelectorList(CSSParserTokenRange&, CSSSelectorList&); |
| 34 void consumeCompoundSelectorList(CSSParserTokenRange&, CSSSelectorList&); | 31 void consumeCompoundSelectorList(CSSParserTokenRange&, CSSSelectorList&); |
| 35 | 32 |
| 36 PassOwnPtr<CSSParserSelector> consumeComplexSelector(CSSParserTokenRange&); | 33 PassOwnPtr<CSSParserSelector> consumeComplexSelector(CSSParserTokenRange&); |
| 37 PassOwnPtr<CSSParserSelector> consumeCompoundSelector(CSSParserTokenRange&); | 34 PassOwnPtr<CSSParserSelector> consumeCompoundSelector(CSSParserTokenRange&); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 59 const CSSParserContext& m_context; | 56 const CSSParserContext& m_context; |
| 60 AtomicString m_defaultNamespace; | 57 AtomicString m_defaultNamespace; |
| 61 StyleSheetContents* m_styleSheet; // FIXME: Should be const | 58 StyleSheetContents* m_styleSheet; // FIXME: Should be const |
| 62 | 59 |
| 63 bool m_failedParsing; | 60 bool m_failedParsing; |
| 64 }; | 61 }; |
| 65 | 62 |
| 66 } // namespace | 63 } // namespace |
| 67 | 64 |
| 68 #endif // CSSSelectorParser_h | 65 #endif // CSSSelectorParser_h |
| OLD | NEW |