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 17 matching lines...) Expand all Loading... |
28 class StyleRuleSupports; | 28 class StyleRuleSupports; |
29 class StyleRuleViewport; | 29 class StyleRuleViewport; |
30 class StyleSheetContents; | 30 class StyleSheetContents; |
31 class ImmutableStylePropertySet; | 31 class ImmutableStylePropertySet; |
32 class Element; | 32 class Element; |
33 class MutableStylePropertySet; | 33 class MutableStylePropertySet; |
34 | 34 |
35 class CSSParserImpl { | 35 class CSSParserImpl { |
36 STACK_ALLOCATED(); | 36 STACK_ALLOCATED(); |
37 public: | 37 public: |
38 CSSParserImpl(const CSSParserContext&, const String&, StyleSheetContents* =
nullptr); | 38 CSSParserImpl(const CSSParserContext&, StyleSheetContents* = nullptr); |
39 | 39 |
40 enum AllowedRulesType { | 40 enum AllowedRulesType { |
41 // As per css-syntax, css-cascade and css-namespaces, @charset rules | 41 // As per css-syntax, css-cascade and css-namespaces, @charset rules |
42 // must come first, followed by @import then @namespace. | 42 // must come first, followed by @import then @namespace. |
43 // AllowImportRules actually means we allow @import and any rules thay | 43 // AllowImportRules actually means we allow @import and any rules thay |
44 // may follow it, i.e. @namespace rules and regular rules. | 44 // may follow it, i.e. @namespace rules and regular rules. |
45 // AllowCharsetRules and AllowNamespaceRules behave similarly. | 45 // AllowCharsetRules and AllowNamespaceRules behave similarly. |
46 AllowCharsetRules, | 46 AllowCharsetRules, |
47 AllowImportRules, | 47 AllowImportRules, |
48 AllowNamespaceRules, | 48 AllowNamespaceRules, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 void consumeDeclarationList(CSSParserTokenRange, StyleRule::Type); | 89 void consumeDeclarationList(CSSParserTokenRange, StyleRule::Type); |
90 void consumeDeclaration(CSSParserTokenRange, StyleRule::Type); | 90 void consumeDeclaration(CSSParserTokenRange, StyleRule::Type); |
91 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool import
ant, StyleRule::Type); | 91 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool import
ant, StyleRule::Type); |
92 | 92 |
93 static PassOwnPtr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange
); | 93 static PassOwnPtr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange
); |
94 | 94 |
95 // FIXME: Can we build StylePropertySets directly? | 95 // FIXME: Can we build StylePropertySets directly? |
96 // FIXME: Investigate using a smaller inline buffer | 96 // FIXME: Investigate using a smaller inline buffer |
97 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; | 97 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; |
98 Vector<CSSParserToken> m_tokens; | |
99 CSSParserContext m_context; | 98 CSSParserContext m_context; |
100 | 99 |
101 AtomicString m_defaultNamespace; | 100 AtomicString m_defaultNamespace; |
102 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; | 101 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; |
103 }; | 102 }; |
104 | 103 |
105 } // namespace blink | 104 } // namespace blink |
106 | 105 |
107 #endif // CSSParserImpl_h | 106 #endif // CSSParserImpl_h |
OLD | NEW |