Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: Source/core/css/parser/CSSSelectorParser.h

Issue 792763003: CSS Parser: Implement selector parsing (pseudo-classes/elements) [3/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@selector2
Patch Set: rebase & handle trailing whitespace Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSParserValues.cpp ('k') | Source/core/css/parser/CSSSelectorParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698