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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserImpl.h

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 AllowImportRules, 50 AllowImportRules,
51 AllowNamespaceRules, 51 AllowNamespaceRules,
52 RegularRules, 52 RegularRules,
53 KeyframeRules, 53 KeyframeRules,
54 ApplyRules, // For @apply inside style rules 54 ApplyRules, // For @apply inside style rules
55 NoRules, // For parsing at-rules inside declaration lists 55 NoRules, // For parsing at-rules inside declaration lists
56 }; 56 };
57 57
58 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String &, bool important, const CSSParserContext&); 58 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String &, bool important, const CSSParserContext&);
59 static bool parseVariableValue(MutableStylePropertySet*, const AtomicString& propertyName, const String&, bool important, const CSSParserContext&); 59 static bool parseVariableValue(MutableStylePropertySet*, const AtomicString& propertyName, const String&, bool important, const CSSParserContext&);
60 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseInlineStyleDec laration(const String&, Element*); 60 static RawPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const S tring&, Element*);
61 static bool parseDeclarationList(MutableStylePropertySet*, const String&, co nst CSSParserContext&); 61 static bool parseDeclarationList(MutableStylePropertySet*, const String&, co nst CSSParserContext&);
62 static PassRefPtrWillBeRawPtr<StyleRuleBase> parseRule(const String&, const CSSParserContext&, StyleSheetContents*, AllowedRulesType); 62 static RawPtr<StyleRuleBase> parseRule(const String&, const CSSParserContext &, StyleSheetContents*, AllowedRulesType);
63 static void parseStyleSheet(const String&, const CSSParserContext&, StyleShe etContents*); 63 static void parseStyleSheet(const String&, const CSSParserContext&, StyleShe etContents*);
64 static CSSSelectorList parsePageSelector(CSSParserTokenRange, StyleSheetCont ents*); 64 static CSSSelectorList parsePageSelector(CSSParserTokenRange, StyleSheetCont ents*);
65 65
66 static PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> parseCustomProperty Set(CSSParserTokenRange); 66 static RawPtr<ImmutableStylePropertySet> parseCustomPropertySet(CSSParserTok enRange);
67 67
68 static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&); 68 static PassOwnPtr<Vector<double>> parseKeyframeKeyList(const String&);
69 69
70 bool supportsDeclaration(CSSParserTokenRange&); 70 bool supportsDeclaration(CSSParserTokenRange&);
71 71
72 static void parseDeclarationListForInspector(const String&, const CSSParserC ontext&, CSSParserObserver&); 72 static void parseDeclarationListForInspector(const String&, const CSSParserC ontext&, CSSParserObserver&);
73 static void parseStyleSheetForInspector(const String&, const CSSParserContex t&, StyleSheetContents*, CSSParserObserver&); 73 static void parseStyleSheetForInspector(const String&, const CSSParserContex t&, StyleSheetContents*, CSSParserObserver&);
74 74
75 private: 75 private:
76 enum RuleListType { 76 enum RuleListType {
77 TopLevelRuleList, 77 TopLevelRuleList,
78 RegularRuleList, 78 RegularRuleList,
79 KeyframesRuleList 79 KeyframesRuleList
80 }; 80 };
81 81
82 // Returns whether the first encountered rule was valid 82 // Returns whether the first encountered rule was valid
83 template<typename T> 83 template<typename T>
84 bool consumeRuleList(CSSParserTokenRange, RuleListType, T callback); 84 bool consumeRuleList(CSSParserTokenRange, RuleListType, T callback);
85 85
86 // These two functions update the range they're given 86 // These two functions update the range they're given
87 PassRefPtrWillBeRawPtr<StyleRuleBase> consumeAtRule(CSSParserTokenRange&, Al lowedRulesType); 87 RawPtr<StyleRuleBase> consumeAtRule(CSSParserTokenRange&, AllowedRulesType);
88 PassRefPtrWillBeRawPtr<StyleRuleBase> consumeQualifiedRule(CSSParserTokenRan ge&, AllowedRulesType); 88 RawPtr<StyleRuleBase> consumeQualifiedRule(CSSParserTokenRange&, AllowedRule sType);
89 89
90 static PassRefPtrWillBeRawPtr<StyleRuleCharset> consumeCharsetRule(CSSParser TokenRange prelude); 90 static RawPtr<StyleRuleCharset> consumeCharsetRule(CSSParserTokenRange prelu de);
91 PassRefPtrWillBeRawPtr<StyleRuleImport> consumeImportRule(CSSParserTokenRang e prelude); 91 RawPtr<StyleRuleImport> consumeImportRule(CSSParserTokenRange prelude);
92 PassRefPtrWillBeRawPtr<StyleRuleNamespace> consumeNamespaceRule(CSSParserTok enRange prelude); 92 RawPtr<StyleRuleNamespace> consumeNamespaceRule(CSSParserTokenRange prelude) ;
93 PassRefPtrWillBeRawPtr<StyleRuleMedia> consumeMediaRule(CSSParserTokenRange prelude, CSSParserTokenRange block); 93 RawPtr<StyleRuleMedia> consumeMediaRule(CSSParserTokenRange prelude, CSSPars erTokenRange block);
94 PassRefPtrWillBeRawPtr<StyleRuleSupports> consumeSupportsRule(CSSParserToken Range prelude, CSSParserTokenRange block); 94 RawPtr<StyleRuleSupports> consumeSupportsRule(CSSParserTokenRange prelude, C SSParserTokenRange block);
95 PassRefPtrWillBeRawPtr<StyleRuleViewport> consumeViewportRule(CSSParserToken Range prelude, CSSParserTokenRange block); 95 RawPtr<StyleRuleViewport> consumeViewportRule(CSSParserTokenRange prelude, C SSParserTokenRange block);
96 PassRefPtrWillBeRawPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserToken Range prelude, CSSParserTokenRange block); 96 RawPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserTokenRange prelude, C SSParserTokenRange block);
97 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitP refixed, CSSParserTokenRange prelude, CSSParserTokenRange block); 97 RawPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitPrefixed, CSSPars erTokenRange prelude, CSSParserTokenRange block);
98 PassRefPtrWillBeRawPtr<StyleRulePage> consumePageRule(CSSParserTokenRange pr elude, CSSParserTokenRange block); 98 RawPtr<StyleRulePage> consumePageRule(CSSParserTokenRange prelude, CSSParser TokenRange block);
99 // Updates m_parsedProperties 99 // Updates m_parsedProperties
100 void consumeApplyRule(CSSParserTokenRange prelude); 100 void consumeApplyRule(CSSParserTokenRange prelude);
101 101
102 PassRefPtrWillBeRawPtr<StyleRuleKeyframe> consumeKeyframeStyleRule(CSSParser TokenRange prelude, CSSParserTokenRange block); 102 RawPtr<StyleRuleKeyframe> consumeKeyframeStyleRule(CSSParserTokenRange prelu de, CSSParserTokenRange block);
103 PassRefPtrWillBeRawPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelu de, CSSParserTokenRange block); 103 RawPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelude, CSSParserTok enRange block);
104 104
105 void consumeDeclarationList(CSSParserTokenRange, StyleRule::RuleType); 105 void consumeDeclarationList(CSSParserTokenRange, StyleRule::RuleType);
106 void consumeDeclaration(CSSParserTokenRange, StyleRule::RuleType); 106 void consumeDeclaration(CSSParserTokenRange, StyleRule::RuleType);
107 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool import ant, StyleRule::RuleType); 107 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool import ant, StyleRule::RuleType);
108 void consumeVariableValue(CSSParserTokenRange, const AtomicString& propertyN ame, bool important); 108 void consumeVariableValue(CSSParserTokenRange, const AtomicString& propertyN ame, bool important);
109 109
110 static PassOwnPtr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange ); 110 static PassOwnPtr<Vector<double>> consumeKeyframeKeyList(CSSParserTokenRange );
111 111
112 // FIXME: Can we build StylePropertySets directly? 112 // FIXME: Can we build StylePropertySets directly?
113 // FIXME: Investigate using a smaller inline buffer 113 // FIXME: Investigate using a smaller inline buffer
114 WillBeHeapVector<CSSProperty, 256> m_parsedProperties; 114 HeapVector<CSSProperty, 256> m_parsedProperties;
115 CSSParserContext m_context; 115 CSSParserContext m_context;
116 116
117 RawPtrWillBeMember<StyleSheetContents> m_styleSheet; 117 Member<StyleSheetContents> m_styleSheet;
118 118
119 // For the inspector 119 // For the inspector
120 CSSParserObserverWrapper* m_observerWrapper; 120 CSSParserObserverWrapper* m_observerWrapper;
121 }; 121 };
122 122
123 } // namespace blink 123 } // namespace blink
124 124
125 #endif // CSSParserImpl_h 125 #endif // CSSParserImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698