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 30 matching lines...) Expand all Loading... |
41 enum AllowedRulesType { | 41 enum AllowedRulesType { |
42 // As per css-syntax, css-cascade and css-namespaces, @charset rules | 42 // As per css-syntax, css-cascade and css-namespaces, @charset rules |
43 // must come first, followed by @import then @namespace. | 43 // must come first, followed by @import then @namespace. |
44 // AllowImportRules actually means we allow @import and any rules thay | 44 // AllowImportRules actually means we allow @import and any rules thay |
45 // may follow it, i.e. @namespace rules and regular rules. | 45 // may follow it, i.e. @namespace rules and regular rules. |
46 // AllowCharsetRules and AllowNamespaceRules behave similarly. | 46 // AllowCharsetRules and AllowNamespaceRules behave similarly. |
47 AllowCharsetRules, | 47 AllowCharsetRules, |
48 AllowImportRules, | 48 AllowImportRules, |
49 AllowNamespaceRules, | 49 AllowNamespaceRules, |
50 RegularRules, | 50 RegularRules, |
51 KeyframeRules | 51 KeyframeRules, |
| 52 NoRules, // For parsing at-rules inside declaration lists |
52 }; | 53 }; |
53 | 54 |
54 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); | 55 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); |
55 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec
laration(const String&, Element*); | 56 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec
laration(const String&, Element*); |
56 static bool parseDeclarationList(MutableStylePropertySet*, const String&, co
nst CSSParserContext&); | 57 static bool parseDeclarationList(MutableStylePropertySet*, const String&, co
nst CSSParserContext&); |
57 static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const String&, const
CSSParserContext&, AllowedRulesType); | 58 static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const String&, const
CSSParserContext&, AllowedRulesType); |
58 static void parseStyleSheet(const String&, const CSSParserContext&, StyleShe
etContents*); | 59 static void parseStyleSheet(const String&, const CSSParserContext&, StyleShe
etContents*); |
59 | 60 |
60 static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); | 61 static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); |
61 | 62 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; | 101 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; |
101 CSSParserContext m_context; | 102 CSSParserContext m_context; |
102 | 103 |
103 AtomicString m_defaultNamespace; | 104 AtomicString m_defaultNamespace; |
104 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; | 105 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; |
105 }; | 106 }; |
106 | 107 |
107 } // namespace blink | 108 } // namespace blink |
108 | 109 |
109 #endif // CSSParserImpl_h | 110 #endif // CSSParserImpl_h |
OLD | NEW |