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 CSSParserImpl_h | 5 #ifndef CSSParserImpl_h |
6 #define CSSParserImpl_h | 6 #define CSSParserImpl_h |
7 | 7 |
8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
9 #include "core/css/CSSProperty.h" | 9 #include "core/css/CSSProperty.h" |
10 #include "core/css/CSSPropertySourceData.h" | 10 #include "core/css/CSSPropertySourceData.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Returns whether the first encountered rule was valid | 77 // Returns whether the first encountered rule was valid |
78 template<typename T> | 78 template<typename T> |
79 bool consumeRuleList(CSSParserTokenRange, RuleListType, T callback); | 79 bool consumeRuleList(CSSParserTokenRange, RuleListType, T callback); |
80 | 80 |
81 // These two functions update the range they're given | 81 // These two functions update the range they're given |
82 PassRefPtrWillBeRawPtr<StyleRuleBase> consumeAtRule(CSSParserTokenRange&, Al
lowedRulesType); | 82 PassRefPtrWillBeRawPtr<StyleRuleBase> consumeAtRule(CSSParserTokenRange&, Al
lowedRulesType); |
83 PassRefPtrWillBeRawPtr<StyleRuleBase> consumeQualifiedRule(CSSParserTokenRan
ge&, AllowedRulesType); | 83 PassRefPtrWillBeRawPtr<StyleRuleBase> consumeQualifiedRule(CSSParserTokenRan
ge&, AllowedRulesType); |
84 | 84 |
85 static PassRefPtrWillBeRawPtr<StyleRuleCharset> consumeCharsetRule(CSSParser
TokenRange prelude); | 85 static PassRefPtrWillBeRawPtr<StyleRuleCharset> consumeCharsetRule(CSSParser
TokenRange prelude); |
86 PassRefPtrWillBeRawPtr<StyleRuleImport> consumeImportRule(CSSParserTokenRang
e prelude); | 86 PassRefPtrWillBeRawPtr<StyleRuleImport> consumeImportRule(CSSParserTokenRang
e prelude); |
87 PassRefPtrWillBeRawPtr<StyleRuleNamespace> consumeNamespaceRule(CSSParserTok
enRange prelude); // This can set m_defaultNamespace | 87 PassRefPtrWillBeRawPtr<StyleRuleNamespace> consumeNamespaceRule(CSSParserTok
enRange prelude); |
88 PassRefPtrWillBeRawPtr<StyleRuleMedia> consumeMediaRule(CSSParserTokenRange
prelude, CSSParserTokenRange block); | 88 PassRefPtrWillBeRawPtr<StyleRuleMedia> consumeMediaRule(CSSParserTokenRange
prelude, CSSParserTokenRange block); |
89 PassRefPtrWillBeRawPtr<StyleRuleSupports> consumeSupportsRule(CSSParserToken
Range prelude, CSSParserTokenRange block); | 89 PassRefPtrWillBeRawPtr<StyleRuleSupports> consumeSupportsRule(CSSParserToken
Range prelude, CSSParserTokenRange block); |
90 PassRefPtrWillBeRawPtr<StyleRuleViewport> consumeViewportRule(CSSParserToken
Range prelude, CSSParserTokenRange block); | 90 PassRefPtrWillBeRawPtr<StyleRuleViewport> consumeViewportRule(CSSParserToken
Range prelude, CSSParserTokenRange block); |
91 PassRefPtrWillBeRawPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserToken
Range prelude, CSSParserTokenRange block); | 91 PassRefPtrWillBeRawPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserToken
Range prelude, CSSParserTokenRange block); |
92 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitP
refixed, CSSParserTokenRange prelude, CSSParserTokenRange block); | 92 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitP
refixed, CSSParserTokenRange prelude, CSSParserTokenRange block); |
93 PassRefPtrWillBeRawPtr<StyleRulePage> consumePageRule(CSSParserTokenRange pr
elude, CSSParserTokenRange block); | 93 PassRefPtrWillBeRawPtr<StyleRulePage> consumePageRule(CSSParserTokenRange pr
elude, CSSParserTokenRange block); |
94 | 94 |
95 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> consumeKeyframeStyleRule(CSSParser
TokenRange prelude, CSSParserTokenRange block); | 95 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> consumeKeyframeStyleRule(CSSParser
TokenRange prelude, CSSParserTokenRange block); |
96 PassRefPtrWillBeRawPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelu
de, CSSParserTokenRange block); | 96 PassRefPtrWillBeRawPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelu
de, CSSParserTokenRange block); |
97 | 97 |
98 void consumeDeclarationList(CSSParserTokenRange, StyleRule::Type); | 98 void consumeDeclarationList(CSSParserTokenRange, StyleRule::Type); |
99 void consumeDeclaration(CSSParserTokenRange, StyleRule::Type); | 99 void consumeDeclaration(CSSParserTokenRange, StyleRule::Type); |
100 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool import
ant, StyleRule::Type); | 100 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool import
ant, StyleRule::Type); |
101 | 101 |
102 static PassOwnPtr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange
); | 102 static PassOwnPtr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange
); |
103 | 103 |
104 // FIXME: Can we build StylePropertySets directly? | 104 // FIXME: Can we build StylePropertySets directly? |
105 // FIXME: Investigate using a smaller inline buffer | 105 // FIXME: Investigate using a smaller inline buffer |
106 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; | 106 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; |
107 CSSParserContext m_context; | 107 CSSParserContext m_context; |
108 | 108 |
109 AtomicString m_defaultNamespace; | |
110 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; | 109 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; |
111 | 110 |
112 // For the inspector | 111 // For the inspector |
113 CSSParserObserverWrapper* m_observerWrapper; | 112 CSSParserObserverWrapper* m_observerWrapper; |
114 }; | 113 }; |
115 | 114 |
116 } // namespace blink | 115 } // namespace blink |
117 | 116 |
118 #endif // CSSParserImpl_h | 117 #endif // CSSParserImpl_h |
OLD | NEW |