| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // AllowCharsetRules and AllowNamespaceRules behave similarly. | 48 // AllowCharsetRules and AllowNamespaceRules behave similarly. |
| 49 AllowCharsetRules, | 49 AllowCharsetRules, |
| 50 AllowImportRules, | 50 AllowImportRules, |
| 51 AllowNamespaceRules, | 51 AllowNamespaceRules, |
| 52 RegularRules, | 52 RegularRules, |
| 53 KeyframeRules, | 53 KeyframeRules, |
| 54 NoRules, // For parsing at-rules inside declaration lists | 54 NoRules, // For parsing at-rules inside declaration lists |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); | 57 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String
&, bool important, const CSSParserContext&); |
| 58 static bool parseVariableValue(MutableStylePropertySet*, const AtomicString&
propertyName, const String&, bool important, const CSSParserContext&); |
| 58 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec
laration(const String&, Element*); | 59 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec
laration(const String&, Element*); |
| 59 static bool parseDeclarationList(MutableStylePropertySet*, const String&, co
nst CSSParserContext&); | 60 static bool parseDeclarationList(MutableStylePropertySet*, const String&, co
nst CSSParserContext&); |
| 60 static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const String&, const
CSSParserContext&, StyleSheetContents*, AllowedRulesType); | 61 static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const String&, const
CSSParserContext&, StyleSheetContents*, AllowedRulesType); |
| 61 static void parseStyleSheet(const String&, const CSSParserContext&, StyleShe
etContents*); | 62 static void parseStyleSheet(const String&, const CSSParserContext&, StyleShe
etContents*); |
| 62 | 63 |
| 63 static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); | 64 static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); |
| 64 | 65 |
| 65 bool supportsDeclaration(CSSParserTokenRange&); | 66 bool supportsDeclaration(CSSParserTokenRange&); |
| 66 | 67 |
| 67 static void parseDeclarationListForInspector(const String&, const CSSParserC
ontext&, CSSParserObserver&); | 68 static void parseDeclarationListForInspector(const String&, const CSSParserC
ontext&, CSSParserObserver&); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 91 PassRefPtrWillBeRawPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserToken
Range prelude, CSSParserTokenRange block); | 92 PassRefPtrWillBeRawPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserToken
Range prelude, CSSParserTokenRange block); |
| 92 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitP
refixed, CSSParserTokenRange prelude, CSSParserTokenRange block); | 93 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitP
refixed, CSSParserTokenRange prelude, CSSParserTokenRange block); |
| 93 PassRefPtrWillBeRawPtr<StyleRulePage> consumePageRule(CSSParserTokenRange pr
elude, CSSParserTokenRange block); | 94 PassRefPtrWillBeRawPtr<StyleRulePage> consumePageRule(CSSParserTokenRange pr
elude, CSSParserTokenRange block); |
| 94 | 95 |
| 95 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> consumeKeyframeStyleRule(CSSParser
TokenRange prelude, CSSParserTokenRange block); | 96 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> consumeKeyframeStyleRule(CSSParser
TokenRange prelude, CSSParserTokenRange block); |
| 96 PassRefPtrWillBeRawPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelu
de, CSSParserTokenRange block); | 97 PassRefPtrWillBeRawPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelu
de, CSSParserTokenRange block); |
| 97 | 98 |
| 98 void consumeDeclarationList(CSSParserTokenRange, StyleRule::Type); | 99 void consumeDeclarationList(CSSParserTokenRange, StyleRule::Type); |
| 99 void consumeDeclaration(CSSParserTokenRange, StyleRule::Type); | 100 void consumeDeclaration(CSSParserTokenRange, StyleRule::Type); |
| 100 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool import
ant, StyleRule::Type); | 101 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool import
ant, StyleRule::Type); |
| 101 void consumeVariableDeclarationValue(CSSParserTokenRange, const AtomicString
& variableName, bool important); | 102 void consumeVariableValue(CSSParserTokenRange, const AtomicString& propertyN
ame, bool important); |
| 102 | 103 |
| 103 static PassOwnPtr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange
); | 104 static PassOwnPtr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange
); |
| 104 | 105 |
| 105 // FIXME: Can we build StylePropertySets directly? | 106 // FIXME: Can we build StylePropertySets directly? |
| 106 // FIXME: Investigate using a smaller inline buffer | 107 // FIXME: Investigate using a smaller inline buffer |
| 107 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; | 108 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; |
| 108 CSSParserContext m_context; | 109 CSSParserContext m_context; |
| 109 | 110 |
| 110 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; | 111 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; |
| 111 | 112 |
| 112 // For the inspector | 113 // For the inspector |
| 113 CSSParserObserverWrapper* m_observerWrapper; | 114 CSSParserObserverWrapper* m_observerWrapper; |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace blink | 117 } // namespace blink |
| 117 | 118 |
| 118 #endif // CSSParserImpl_h | 119 #endif // CSSParserImpl_h |
| OLD | NEW |