OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve
d. | 5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve
d. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 FFrequency = 0x0040, | 65 FFrequency = 0x0040, |
66 FPositiveInteger = 0x0080, | 66 FPositiveInteger = 0x0080, |
67 FRelative = 0x0100, | 67 FRelative = 0x0100, |
68 FResolution = 0x0200, | 68 FResolution = 0x0200, |
69 FNonNeg = 0x0400, | 69 FNonNeg = 0x0400, |
70 FUnitlessQuirk = 0x0800 | 70 FUnitlessQuirk = 0x0800 |
71 }; | 71 }; |
72 | 72 |
73 static bool parseValue(CSSPropertyID, bool important, | 73 static bool parseValue(CSSPropertyID, bool important, |
74 CSSParserValueList*, const CSSParserContext&, | 74 CSSParserValueList*, const CSSParserContext&, |
75 WillBeHeapVector<CSSProperty, 256>&, StyleRule::Type); | 75 Vector<CSSProperty, 256>&, StyleRule::Type); |
76 | 76 |
77 static bool isSystemColor(CSSValueID); | 77 static bool isSystemColor(CSSValueID); |
78 static bool isColorKeyword(CSSValueID); | 78 static bool isColorKeyword(CSSValueID); |
79 | 79 |
80 private: | 80 private: |
81 CSSPropertyParser(CSSParserValueList*, const CSSParserContext&, | 81 CSSPropertyParser(CSSParserValueList*, const CSSParserContext&, |
82 WillBeHeapVector<CSSProperty, 256>&, StyleRule::Type); | 82 Vector<CSSProperty, 256>&, StyleRule::Type); |
83 | 83 |
84 bool parseValue(CSSPropertyID, bool important); | 84 bool parseValue(CSSPropertyID, bool important); |
85 | 85 |
86 bool inShorthand() const { return m_inParseShorthand; } | 86 bool inShorthand() const { return m_inParseShorthand; } |
87 bool inQuirksMode() const { return isQuirksModeBehavior(m_context.mode()); } | 87 bool inQuirksMode() const { return isQuirksModeBehavior(m_context.mode()); } |
88 | 88 |
89 bool parseViewportProperty(CSSPropertyID propId, bool important); | 89 bool parseViewportProperty(CSSPropertyID propId, bool important); |
90 bool parseViewportShorthand(CSSPropertyID propId, CSSPropertyID first, CSSPr
opertyID second, bool important); | 90 bool parseViewportShorthand(CSSPropertyID propId, CSSPropertyID first, CSSPr
opertyID second, bool important); |
91 bool parseFontFaceDescriptor(CSSPropertyID); | 91 bool parseFontFaceDescriptor(CSSPropertyID); |
92 | 92 |
93 KURL completeURL(const String& url) const; | 93 KURL completeURL(const String& url) const; |
94 | 94 |
95 void addProperty(CSSPropertyID, PassRefPtrWillBeRawPtr<CSSValue>, bool impor
tant, bool implicit = false); | 95 void addProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important, bool i
mplicit = false); |
96 void rollbackLastProperties(int num); | 96 void rollbackLastProperties(int num); |
97 void addExpandedPropertyForValue(CSSPropertyID propId, PassRefPtrWillBeRawPt
r<CSSValue>, bool); | 97 void addExpandedPropertyForValue(CSSPropertyID propId, PassRefPtr<CSSValue>,
bool); |
98 | 98 |
99 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseValidPrimitive(CSSValueID ide
nt, CSSParserValue*); | 99 PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(CSSValueID ident, CSSParse
rValue*); |
100 | 100 |
101 bool parseShorthand(CSSPropertyID, const StylePropertyShorthand&, bool impor
tant); | 101 bool parseShorthand(CSSPropertyID, const StylePropertyShorthand&, bool impor
tant); |
102 bool parse4Values(CSSPropertyID, const CSSPropertyID* properties, bool impor
tant); | 102 bool parse4Values(CSSPropertyID, const CSSPropertyID* properties, bool impor
tant); |
103 PassRefPtrWillBeRawPtr<CSSValueList> parseContent(); | 103 PassRefPtr<CSSValueList> parseContent(); |
104 PassRefPtrWillBeRawPtr<CSSValue> parseQuotes(); | 104 PassRefPtr<CSSValue> parseQuotes(); |
105 | 105 |
106 PassRefPtrWillBeRawPtr<CSSValue> parseAttr(CSSParserValueList* args); | 106 PassRefPtr<CSSValue> parseAttr(CSSParserValueList* args); |
107 | 107 |
108 bool parseFillImage(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&); | 108 bool parseFillImage(CSSParserValueList*, RefPtr<CSSValue>&); |
109 | 109 |
110 enum FillPositionFlag { InvalidFillPosition = 0, AmbiguousFillPosition = 1,
XFillPosition = 2, YFillPosition = 4 }; | 110 enum FillPositionFlag { InvalidFillPosition = 0, AmbiguousFillPosition = 1,
XFillPosition = 2, YFillPosition = 4 }; |
111 enum FillPositionParsingMode { ResolveValuesAsPercent = 0, ResolveValuesAsKe
yword = 1 }; | 111 enum FillPositionParsingMode { ResolveValuesAsPercent = 0, ResolveValuesAsKe
yword = 1 }; |
112 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseFillPositionComponent(CSSPars
erValueList*, unsigned& cumulativeFlags, FillPositionFlag& individualFlag, FillP
ositionParsingMode = ResolveValuesAsPercent, Units = FUnknown); | 112 PassRefPtr<CSSPrimitiveValue> parseFillPositionComponent(CSSParserValueList*
, unsigned& cumulativeFlags, FillPositionFlag& individualFlag, FillPositionParsi
ngMode = ResolveValuesAsPercent, Units = FUnknown); |
113 PassRefPtrWillBeRawPtr<CSSValue> parseFillPositionX(CSSParserValueList*); | 113 PassRefPtr<CSSValue> parseFillPositionX(CSSParserValueList*); |
114 PassRefPtrWillBeRawPtr<CSSValue> parseFillPositionY(CSSParserValueList*); | 114 PassRefPtr<CSSValue> parseFillPositionY(CSSParserValueList*); |
115 void parse2ValuesFillPosition(CSSParserValueList*, RefPtrWillBeRawPtr<CSSVal
ue>&, RefPtrWillBeRawPtr<CSSValue>&, Units = FUnknown); | 115 void parse2ValuesFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr
<CSSValue>&, Units = FUnknown); |
116 bool isPotentialPositionValue(CSSParserValue*); | 116 bool isPotentialPositionValue(CSSParserValue*); |
117 void parseFillPosition(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&, R
efPtrWillBeRawPtr<CSSValue>&, Units = FUnknown); | 117 void parseFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSVal
ue>&, Units = FUnknown); |
118 void parse3ValuesFillPosition(CSSParserValueList*, RefPtrWillBeRawPtr<CSSVal
ue>&, RefPtrWillBeRawPtr<CSSValue>&, PassRefPtrWillBeRawPtr<CSSPrimitiveValue>,
PassRefPtrWillBeRawPtr<CSSPrimitiveValue>); | 118 void parse3ValuesFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr
<CSSValue>&, PassRefPtr<CSSPrimitiveValue>, PassRefPtr<CSSPrimitiveValue>); |
119 void parse4ValuesFillPosition(CSSParserValueList*, RefPtrWillBeRawPtr<CSSVal
ue>&, RefPtrWillBeRawPtr<CSSValue>&, PassRefPtrWillBeRawPtr<CSSPrimitiveValue>,
PassRefPtrWillBeRawPtr<CSSPrimitiveValue>); | 119 void parse4ValuesFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr
<CSSValue>&, PassRefPtr<CSSPrimitiveValue>, PassRefPtr<CSSPrimitiveValue>); |
120 | 120 |
121 void parseFillRepeat(RefPtrWillBeRawPtr<CSSValue>&, RefPtrWillBeRawPtr<CSSVa
lue>&); | 121 void parseFillRepeat(RefPtr<CSSValue>&, RefPtr<CSSValue>&); |
122 PassRefPtrWillBeRawPtr<CSSValue> parseFillSize(CSSPropertyID); | 122 PassRefPtr<CSSValue> parseFillSize(CSSPropertyID); |
123 | 123 |
124 bool parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1, CSSProp
ertyID& propId2, RefPtrWillBeRawPtr<CSSValue>&, RefPtrWillBeRawPtr<CSSValue>&); | 124 bool parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1, CSSProp
ertyID& propId2, RefPtr<CSSValue>&, RefPtr<CSSValue>&); |
125 bool parseFillShorthand(CSSPropertyID, const CSSPropertyID* properties, int
numProperties, bool important); | 125 bool parseFillShorthand(CSSPropertyID, const CSSPropertyID* properties, int
numProperties, bool important); |
126 | 126 |
127 void addFillValue(RefPtrWillBeRawPtr<CSSValue>& lval, PassRefPtrWillBeRawPtr
<CSSValue> rval); | 127 void addFillValue(RefPtr<CSSValue>& lval, PassRefPtr<CSSValue> rval); |
128 | 128 |
129 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationDelay(); | 129 PassRefPtr<CSSValue> parseAnimationDelay(); |
130 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationDirection(); | 130 PassRefPtr<CSSValue> parseAnimationDirection(); |
131 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationDuration(); | 131 PassRefPtr<CSSValue> parseAnimationDuration(); |
132 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationFillMode(); | 132 PassRefPtr<CSSValue> parseAnimationFillMode(); |
133 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationIterationCount(); | 133 PassRefPtr<CSSValue> parseAnimationIterationCount(); |
134 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationName(bool allowQuotedName); | 134 PassRefPtr<CSSValue> parseAnimationName(bool allowQuotedName); |
135 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationPlayState(); | 135 PassRefPtr<CSSValue> parseAnimationPlayState(); |
136 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationProperty(); | 136 PassRefPtr<CSSValue> parseAnimationProperty(); |
137 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationTimingFunction(); | 137 PassRefPtr<CSSValue> parseAnimationTimingFunction(); |
138 | 138 |
139 bool parseCubicBezierTimingFunctionValue(CSSParserValueList*& args, double&
result); | 139 bool parseCubicBezierTimingFunctionValue(CSSParserValueList*& args, double&
result); |
140 | 140 |
141 // Legacy parsing allows <string>s for animation-name | 141 // Legacy parsing allows <string>s for animation-name |
142 PassRefPtrWillBeRawPtr<CSSValue> parseAnimationProperty(CSSPropertyID, bool
useLegacyParsing); | 142 PassRefPtr<CSSValue> parseAnimationProperty(CSSPropertyID, bool useLegacyPar
sing); |
143 PassRefPtrWillBeRawPtr<CSSValueList> parseAnimationPropertyList(CSSPropertyI
D, bool useLegacyParsing); | 143 PassRefPtr<CSSValueList> parseAnimationPropertyList(CSSPropertyID, bool useL
egacyParsing); |
144 bool parseAnimationShorthand(bool useLegacyParsing, bool important); | 144 bool parseAnimationShorthand(bool useLegacyParsing, bool important); |
145 bool parseTransitionShorthand(bool important); | 145 bool parseTransitionShorthand(bool important); |
146 | 146 |
147 PassRefPtrWillBeRawPtr<CSSValue> parseColumnWidth(); | 147 PassRefPtr<CSSValue> parseColumnWidth(); |
148 PassRefPtrWillBeRawPtr<CSSValue> parseColumnCount(); | 148 PassRefPtr<CSSValue> parseColumnCount(); |
149 bool parseColumnsShorthand(bool important); | 149 bool parseColumnsShorthand(bool important); |
150 | 150 |
151 PassRefPtrWillBeRawPtr<CSSValue> parseGridPosition(); | 151 PassRefPtr<CSSValue> parseGridPosition(); |
152 bool parseIntegerOrCustomIdentFromGridPosition(RefPtrWillBeRawPtr<CSSPrimiti
veValue>& numericValue, RefPtrWillBeRawPtr<CSSPrimitiveValue>& gridLineName); | 152 bool parseIntegerOrCustomIdentFromGridPosition(RefPtr<CSSPrimitiveValue>& nu
mericValue, RefPtr<CSSPrimitiveValue>& gridLineName); |
153 bool parseGridItemPositionShorthand(CSSPropertyID, bool important); | 153 bool parseGridItemPositionShorthand(CSSPropertyID, bool important); |
154 bool parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSSValue>, bool im
portant); | 154 bool parseGridTemplateRowsAndAreas(PassRefPtr<CSSValue>, bool important); |
155 bool parseGridTemplateShorthand(bool important); | 155 bool parseGridTemplateShorthand(bool important); |
156 bool parseGridShorthand(bool important); | 156 bool parseGridShorthand(bool important); |
157 bool parseGridAreaShorthand(bool important); | 157 bool parseGridAreaShorthand(bool important); |
158 bool parseSingleGridAreaLonghand(RefPtrWillBeRawPtr<CSSValue>&); | 158 bool parseSingleGridAreaLonghand(RefPtr<CSSValue>&); |
159 PassRefPtrWillBeRawPtr<CSSValue> parseGridTrackList(); | 159 PassRefPtr<CSSValue> parseGridTrackList(); |
160 bool parseGridTrackRepeatFunction(CSSValueList&); | 160 bool parseGridTrackRepeatFunction(CSSValueList&); |
161 PassRefPtrWillBeRawPtr<CSSValue> parseGridTrackSize(CSSParserValueList& inpu
tList); | 161 PassRefPtr<CSSValue> parseGridTrackSize(CSSParserValueList& inputList); |
162 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseGridBreadth(CSSParserValue*); | 162 PassRefPtr<CSSPrimitiveValue> parseGridBreadth(CSSParserValue*); |
163 bool parseGridTemplateAreasRow(NamedGridAreaMap&, const size_t, size_t&); | 163 bool parseGridTemplateAreasRow(NamedGridAreaMap&, const size_t, size_t&); |
164 PassRefPtrWillBeRawPtr<CSSValue> parseGridTemplateAreas(); | 164 PassRefPtr<CSSValue> parseGridTemplateAreas(); |
165 bool parseGridLineNames(CSSParserValueList&, CSSValueList&, CSSGridLineNames
Value* = nullptr); | 165 bool parseGridLineNames(CSSParserValueList&, CSSValueList&, CSSGridLineNames
Value* = nullptr); |
166 PassRefPtrWillBeRawPtr<CSSValue> parseGridAutoFlow(CSSParserValueList&); | 166 PassRefPtr<CSSValue> parseGridAutoFlow(CSSParserValueList&); |
167 | 167 |
168 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseClipShape(); | 168 PassRefPtr<CSSPrimitiveValue> parseClipShape(); |
169 | 169 |
170 bool parseLegacyPosition(CSSPropertyID, bool important); | 170 bool parseLegacyPosition(CSSPropertyID, bool important); |
171 bool parseItemPositionOverflowPosition(CSSPropertyID, bool important); | 171 bool parseItemPositionOverflowPosition(CSSPropertyID, bool important); |
172 PassRefPtrWillBeRawPtr<CSSValue> parseContentDistributionOverflowPosition(); | 172 PassRefPtr<CSSValue> parseContentDistributionOverflowPosition(); |
173 | 173 |
174 PassRefPtrWillBeRawPtr<CSSValue> parseShapeProperty(CSSPropertyID propId); | 174 PassRefPtr<CSSValue> parseShapeProperty(CSSPropertyID propId); |
175 PassRefPtrWillBeRawPtr<CSSValue> parseBasicShapeAndOrBox(); | 175 PassRefPtr<CSSValue> parseBasicShapeAndOrBox(); |
176 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseBasicShape(); | 176 PassRefPtr<CSSPrimitiveValue> parseBasicShape(); |
177 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseShapeRadius(CSSParserValue*); | 177 PassRefPtr<CSSPrimitiveValue> parseShapeRadius(CSSParserValue*); |
178 | 178 |
179 PassRefPtrWillBeRawPtr<CSSBasicShape> parseBasicShapeCircle(CSSParserValueLi
st* args); | 179 PassRefPtr<CSSBasicShape> parseBasicShapeCircle(CSSParserValueList* args); |
180 PassRefPtrWillBeRawPtr<CSSBasicShape> parseBasicShapeEllipse(CSSParserValueL
ist* args); | 180 PassRefPtr<CSSBasicShape> parseBasicShapeEllipse(CSSParserValueList* args); |
181 PassRefPtrWillBeRawPtr<CSSBasicShape> parseBasicShapePolygon(CSSParserValueL
ist* args); | 181 PassRefPtr<CSSBasicShape> parseBasicShapePolygon(CSSParserValueList* args); |
182 PassRefPtrWillBeRawPtr<CSSBasicShape> parseBasicShapeInset(CSSParserValueLis
t* args); | 182 PassRefPtr<CSSBasicShape> parseBasicShapeInset(CSSParserValueList* args); |
183 | 183 |
184 bool parseFont(bool important); | 184 bool parseFont(bool important); |
185 bool parseSystemFont(bool important); | 185 bool parseSystemFont(bool important); |
186 PassRefPtrWillBeRawPtr<CSSValueList> parseFontFamily(); | 186 PassRefPtr<CSSValueList> parseFontFamily(); |
187 | 187 |
188 PassRefPtrWillBeRawPtr<CSSValue> parseCounter(int defaultValue); | 188 PassRefPtr<CSSValue> parseCounter(int defaultValue); |
189 PassRefPtrWillBeRawPtr<CSSValue> parseCounterContent(CSSParserValueList* arg
s, bool counters); | 189 PassRefPtr<CSSValue> parseCounterContent(CSSParserValueList* args, bool coun
ters); |
190 | 190 |
191 bool parseColorParameters(const CSSParserValue*, int* colorValues, bool pars
eAlpha); | 191 bool parseColorParameters(const CSSParserValue*, int* colorValues, bool pars
eAlpha); |
192 bool parseHSLParameters(const CSSParserValue*, double* colorValues, bool par
seAlpha); | 192 bool parseHSLParameters(const CSSParserValue*, double* colorValues, bool par
seAlpha); |
193 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseColor(const CSSParserValue*,
bool acceptQuirkyColors = false); | 193 PassRefPtr<CSSPrimitiveValue> parseColor(const CSSParserValue*, bool acceptQ
uirkyColors = false); |
194 bool parseColorFromValue(const CSSParserValue*, RGBA32&, bool acceptQuirkyCo
lors = false); | 194 bool parseColorFromValue(const CSSParserValue*, RGBA32&, bool acceptQuirkyCo
lors = false); |
195 | 195 |
196 bool acceptQuirkyColors(CSSPropertyID) const; | 196 bool acceptQuirkyColors(CSSPropertyID) const; |
197 | 197 |
198 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseLineHeight(); | 198 PassRefPtr<CSSPrimitiveValue> parseLineHeight(); |
199 bool parseFontSize(bool important); | 199 bool parseFontSize(bool important); |
200 bool parseFontVariant(bool important); | 200 bool parseFontVariant(bool important); |
201 bool parseFontWeight(bool important); | 201 bool parseFontWeight(bool important); |
202 PassRefPtrWillBeRawPtr<CSSValueList> parseFontFaceSrc(); | 202 PassRefPtr<CSSValueList> parseFontFaceSrc(); |
203 PassRefPtrWillBeRawPtr<CSSValueList> parseFontFaceUnicodeRange(); | 203 PassRefPtr<CSSValueList> parseFontFaceUnicodeRange(); |
204 | 204 |
205 bool parseSVGValue(CSSPropertyID propId, bool important); | 205 bool parseSVGValue(CSSPropertyID propId, bool important); |
206 PassRefPtrWillBeRawPtr<CSSValue> parseSVGStrokeDasharray(); | 206 PassRefPtr<CSSValue> parseSVGStrokeDasharray(); |
207 | 207 |
208 PassRefPtrWillBeRawPtr<CSSValue> parsePaintOrder() const; | 208 PassRefPtr<CSSValue> parsePaintOrder() const; |
209 | 209 |
210 // CSS3 Parsing Routines (for properties specific to CSS3) | 210 // CSS3 Parsing Routines (for properties specific to CSS3) |
211 PassRefPtrWillBeRawPtr<CSSValueList> parseShadow(CSSParserValueList*, CSSPro
pertyID); | 211 PassRefPtr<CSSValueList> parseShadow(CSSParserValueList*, CSSPropertyID); |
212 bool parseBorderImageShorthand(CSSPropertyID, bool important); | 212 bool parseBorderImageShorthand(CSSPropertyID, bool important); |
213 PassRefPtrWillBeRawPtr<CSSValue> parseBorderImage(CSSPropertyID); | 213 PassRefPtr<CSSValue> parseBorderImage(CSSPropertyID); |
214 bool parseBorderImageRepeat(RefPtrWillBeRawPtr<CSSValue>&); | 214 bool parseBorderImageRepeat(RefPtr<CSSValue>&); |
215 bool parseBorderImageSlice(CSSPropertyID, RefPtrWillBeRawPtr<CSSBorderImageS
liceValue>&); | 215 bool parseBorderImageSlice(CSSPropertyID, RefPtr<CSSBorderImageSliceValue>&)
; |
216 bool parseBorderImageWidth(RefPtrWillBeRawPtr<CSSPrimitiveValue>&); | 216 bool parseBorderImageWidth(RefPtr<CSSPrimitiveValue>&); |
217 bool parseBorderImageOutset(RefPtrWillBeRawPtr<CSSPrimitiveValue>&); | 217 bool parseBorderImageOutset(RefPtr<CSSPrimitiveValue>&); |
218 bool parseBorderRadius(CSSPropertyID, bool important); | 218 bool parseBorderRadius(CSSPropertyID, bool important); |
219 | 219 |
220 PassRefPtrWillBeRawPtr<CSSValue> parseReflect(); | 220 PassRefPtr<CSSValue> parseReflect(); |
221 | 221 |
222 bool parseFlex(CSSParserValueList* args, bool important); | 222 bool parseFlex(CSSParserValueList* args, bool important); |
223 | 223 |
224 PassRefPtrWillBeRawPtr<CSSValue> parsePosition(CSSParserValueList*); | 224 PassRefPtr<CSSValue> parsePosition(CSSParserValueList*); |
225 PassRefPtrWillBeRawPtr<CSSValueList> parsePositionList(CSSParserValueList*); | 225 PassRefPtr<CSSValueList> parsePositionList(CSSParserValueList*); |
226 | 226 |
227 // Image generators | 227 // Image generators |
228 bool parseCanvas(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&); | 228 bool parseCanvas(CSSParserValueList*, RefPtr<CSSValue>&); |
229 | 229 |
230 bool parseDeprecatedGradient(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValu
e>&); | 230 bool parseDeprecatedGradient(CSSParserValueList*, RefPtr<CSSValue>&); |
231 bool parseDeprecatedLinearGradient(CSSParserValueList*, RefPtrWillBeRawPtr<C
SSValue>&, CSSGradientRepeat repeating); | 231 bool parseDeprecatedLinearGradient(CSSParserValueList*, RefPtr<CSSValue>&, C
SSGradientRepeat repeating); |
232 bool parseDeprecatedRadialGradient(CSSParserValueList*, RefPtrWillBeRawPtr<C
SSValue>&, CSSGradientRepeat repeating); | 232 bool parseDeprecatedRadialGradient(CSSParserValueList*, RefPtr<CSSValue>&, C
SSGradientRepeat repeating); |
233 bool parseLinearGradient(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&,
CSSGradientRepeat repeating); | 233 bool parseLinearGradient(CSSParserValueList*, RefPtr<CSSValue>&, CSSGradient
Repeat repeating); |
234 bool parseRadialGradient(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&,
CSSGradientRepeat repeating); | 234 bool parseRadialGradient(CSSParserValueList*, RefPtr<CSSValue>&, CSSGradient
Repeat repeating); |
235 bool parseGradientColorStops(CSSParserValueList*, CSSGradientValue*, bool ex
pectComma); | 235 bool parseGradientColorStops(CSSParserValueList*, CSSGradientValue*, bool ex
pectComma); |
236 | 236 |
237 bool parseCrossfade(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&); | 237 bool parseCrossfade(CSSParserValueList*, RefPtr<CSSValue>&); |
238 | 238 |
239 PassRefPtrWillBeRawPtr<CSSValue> parseImageSet(CSSParserValueList*); | 239 PassRefPtr<CSSValue> parseImageSet(CSSParserValueList*); |
240 | 240 |
241 PassRefPtrWillBeRawPtr<CSSValue> parseWillChange(); | 241 PassRefPtr<CSSValue> parseWillChange(); |
242 | 242 |
243 PassRefPtrWillBeRawPtr<CSSValueList> parseFilter(); | 243 PassRefPtr<CSSValueList> parseFilter(); |
244 PassRefPtrWillBeRawPtr<CSSFunctionValue> parseBuiltinFilterArguments(CSSPars
erValueList*, CSSValueID); | 244 PassRefPtr<CSSFunctionValue> parseBuiltinFilterArguments(CSSParserValueList*
, CSSValueID); |
245 | 245 |
246 PassRefPtrWillBeRawPtr<CSSValueList> parseTransformOrigin(); | 246 PassRefPtr<CSSValueList> parseTransformOrigin(); |
247 PassRefPtrWillBeRawPtr<CSSValueList> parseTransform(bool useLegacyParsing); | 247 PassRefPtr<CSSValueList> parseTransform(bool useLegacyParsing); |
248 PassRefPtrWillBeRawPtr<CSSValue> parseTransformValue(bool useLegacyParsing,
CSSParserValue*); | 248 PassRefPtr<CSSValue> parseTransformValue(bool useLegacyParsing, CSSParserVal
ue*); |
249 | 249 |
250 PassRefPtrWillBeRawPtr<CSSValue> parseMotionPath(); | 250 PassRefPtr<CSSValue> parseMotionPath(); |
251 PassRefPtrWillBeRawPtr<CSSValue> parseMotionRotation(); | 251 PassRefPtr<CSSValue> parseMotionRotation(); |
252 | 252 |
253 PassRefPtrWillBeRawPtr<CSSValue> parseTextEmphasisStyle(); | 253 PassRefPtr<CSSValue> parseTextEmphasisStyle(); |
254 | 254 |
255 PassRefPtrWillBeRawPtr<CSSValue> parseTouchAction(); | 255 PassRefPtr<CSSValue> parseTouchAction(); |
256 | 256 |
257 PassRefPtrWillBeRawPtr<CSSValue> parseTextDecoration(); | 257 PassRefPtr<CSSValue> parseTextDecoration(); |
258 | 258 |
259 PassRefPtrWillBeRawPtr<CSSValue> parseTextIndent(); | 259 PassRefPtr<CSSValue> parseTextIndent(); |
260 | 260 |
261 PassRefPtrWillBeRawPtr<CSSLineBoxContainValue> parseLineBoxContain(); | 261 PassRefPtr<CSSLineBoxContainValue> parseLineBoxContain(); |
262 bool parseCalculation(CSSParserValue*, ValueRange); | 262 bool parseCalculation(CSSParserValue*, ValueRange); |
263 | 263 |
264 bool parseFontFeatureTag(CSSValueList*); | 264 bool parseFontFeatureTag(CSSValueList*); |
265 PassRefPtrWillBeRawPtr<CSSValue> parseFontFeatureSettings(); | 265 PassRefPtr<CSSValue> parseFontFeatureSettings(); |
266 | 266 |
267 bool parseFontVariantLigatures(bool important); | 267 bool parseFontVariantLigatures(bool important); |
268 | 268 |
269 bool parseGeneratedImage(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&)
; | 269 bool parseGeneratedImage(CSSParserValueList*, RefPtr<CSSValue>&); |
270 | 270 |
271 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSPar
serValue*); | 271 PassRefPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSParserValue*); |
272 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createPrimitiveStringValue(CSSPars
erValue*); | 272 PassRefPtr<CSSPrimitiveValue> createPrimitiveStringValue(CSSParserValue*); |
273 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createPrimitiveCustomIdentValue(CS
SParserValue*); | 273 PassRefPtr<CSSPrimitiveValue> createPrimitiveCustomIdentValue(CSSParserValue
*); |
274 | 274 |
275 PassRefPtrWillBeRawPtr<CSSValue> createCSSImageValueWithReferrer(const Strin
g& rawValue, const KURL&); | 275 PassRefPtr<CSSValue> createCSSImageValueWithReferrer(const String& rawValue,
const KURL&); |
276 | 276 |
277 PassRefPtrWillBeRawPtr<CSSBasicShape> parseInsetRoundedCorners(PassRefPtrWil
lBeRawPtr<CSSBasicShapeInset>, CSSParserValueList*); | 277 PassRefPtr<CSSBasicShape> parseInsetRoundedCorners(PassRefPtr<CSSBasicShapeI
nset>, CSSParserValueList*); |
278 | 278 |
279 enum SizeParameterType { | 279 enum SizeParameterType { |
280 None, | 280 None, |
281 Auto, | 281 Auto, |
282 Length, | 282 Length, |
283 PageSize, | 283 PageSize, |
284 Orientation, | 284 Orientation, |
285 }; | 285 }; |
286 | 286 |
287 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsePage(); | 287 PassRefPtr<CSSPrimitiveValue> parsePage(); |
288 PassRefPtrWillBeRawPtr<CSSValueList> parseSize(); | 288 PassRefPtr<CSSValueList> parseSize(); |
289 SizeParameterType parseSizeParameter(CSSValueList* parsedValues, CSSParserVa
lue*, SizeParameterType prevParamType); | 289 SizeParameterType parseSizeParameter(CSSValueList* parsedValues, CSSParserVa
lue*, SizeParameterType prevParamType); |
290 | 290 |
291 bool parseFontFaceSrcURI(CSSValueList*); | 291 bool parseFontFaceSrcURI(CSSValueList*); |
292 bool parseFontFaceSrcLocal(CSSValueList*); | 292 bool parseFontFaceSrcLocal(CSSValueList*); |
293 | 293 |
294 class ImplicitScope { | 294 class ImplicitScope { |
295 STACK_ALLOCATED(); | 295 STACK_ALLOCATED(); |
296 WTF_MAKE_NONCOPYABLE(ImplicitScope); | 296 WTF_MAKE_NONCOPYABLE(ImplicitScope); |
297 public: | 297 public: |
298 ImplicitScope(CSSPropertyParser* parser) | 298 ImplicitScope(CSSPropertyParser* parser) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 bool validWidthOrHeight(CSSParserValue*, Units); | 341 bool validWidthOrHeight(CSSParserValue*, Units); |
342 | 342 |
343 bool validCalculationUnit(CSSParserValue*, Units, ReleaseParsedCalcValueCond
ition releaseCalc = DoNotReleaseParsedCalcValue); | 343 bool validCalculationUnit(CSSParserValue*, Units, ReleaseParsedCalcValueCond
ition releaseCalc = DoNotReleaseParsedCalcValue); |
344 | 344 |
345 bool shouldAcceptUnitLessValues(CSSParserValue*, Units, CSSParserMode); | 345 bool shouldAcceptUnitLessValues(CSSParserValue*, Units, CSSParserMode); |
346 | 346 |
347 inline bool validUnit(CSSParserValue* value, Units unitflags, ReleaseParsedC
alcValueCondition releaseCalc = DoNotReleaseParsedCalcValue) { return validUnit(
value, unitflags, m_context.mode(), releaseCalc); } | 347 inline bool validUnit(CSSParserValue* value, Units unitflags, ReleaseParsedC
alcValueCondition releaseCalc = DoNotReleaseParsedCalcValue) { return validUnit(
value, unitflags, m_context.mode(), releaseCalc); } |
348 bool validUnit(CSSParserValue*, Units, CSSParserMode, ReleaseParsedCalcValue
Condition releaseCalc = DoNotReleaseParsedCalcValue); | 348 bool validUnit(CSSParserValue*, Units, CSSParserMode, ReleaseParsedCalcValue
Condition releaseCalc = DoNotReleaseParsedCalcValue); |
349 | 349 |
350 bool parseBorderImageQuad(Units, RefPtrWillBeRawPtr<CSSPrimitiveValue>&); | 350 bool parseBorderImageQuad(Units, RefPtr<CSSPrimitiveValue>&); |
351 int colorIntFromValue(CSSParserValue*); | 351 int colorIntFromValue(CSSParserValue*); |
352 | 352 |
353 bool buildBorderImageParseContext(CSSPropertyID, BorderImageParseContext&); | 353 bool buildBorderImageParseContext(CSSPropertyID, BorderImageParseContext&); |
354 | 354 |
355 bool parseDeprecatedGradientColorStop(CSSParserValue*, CSSGradientColorStop&
); | 355 bool parseDeprecatedGradientColorStop(CSSParserValue*, CSSGradientColorStop&
); |
356 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseDeprecatedGradientStopColor(c
onst CSSParserValue*); | 356 PassRefPtr<CSSPrimitiveValue> parseDeprecatedGradientStopColor(const CSSPars
erValue*); |
357 | 357 |
358 void commitBorderImageProperty(CSSPropertyID, PassRefPtrWillBeRawPtr<CSSValu
e>, bool important); | 358 void commitBorderImageProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool imp
ortant); |
359 | 359 |
360 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapPoints(); | 360 PassRefPtr<CSSValue> parseScrollSnapPoints(); |
361 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapDestination(); | 361 PassRefPtr<CSSValue> parseScrollSnapDestination(); |
362 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapCoordinate(); | 362 PassRefPtr<CSSValue> parseScrollSnapCoordinate(); |
363 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapPosition(); | 363 PassRefPtr<CSSValue> parseScrollSnapPosition(); |
364 | 364 |
365 private: | 365 private: |
366 // Inputs: | 366 // Inputs: |
367 CSSParserValueList* m_valueList; | 367 CSSParserValueList* m_valueList; |
368 const CSSParserContext& m_context; | 368 const CSSParserContext& m_context; |
369 | 369 |
370 // Outputs: | 370 // Outputs: |
371 WillBeHeapVector<CSSProperty, 256>& m_parsedProperties; | 371 Vector<CSSProperty, 256>& m_parsedProperties; |
372 StyleRule::Type m_ruleType; | 372 StyleRule::Type m_ruleType; |
373 | 373 |
374 // Locals during parsing: | 374 // Locals during parsing: |
375 int m_inParseShorthand; | 375 int m_inParseShorthand; |
376 CSSPropertyID m_currentShorthand; | 376 CSSPropertyID m_currentShorthand; |
377 bool m_implicitShorthand; | 377 bool m_implicitShorthand; |
378 RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation; | 378 RefPtr<CSSCalcValue> m_parsedCalculation; |
379 }; | 379 }; |
380 | 380 |
381 CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&); | 381 CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&); |
382 CSSValueID cssValueKeywordID(const CSSParserString&); | 382 CSSValueID cssValueKeywordID(const CSSParserString&); |
383 | 383 |
384 } // namespace blink | 384 } // namespace blink |
385 | 385 |
386 #endif // CSSPropertyParser_h | 386 #endif // CSSPropertyParser_h |
OLD | NEW |