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

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

Issue 1506983002: Cleanup CSSPropertyParser some more (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 static bool isValidNumericValue(double); 93 static bool isValidNumericValue(double);
94 94
95 // TODO(rwlbuis): move to CSSPropertyParser.cpp once CSSParserToken conversi on is done. 95 // TODO(rwlbuis): move to CSSPropertyParser.cpp once CSSParserToken conversi on is done.
96 static PassRefPtrWillBeRawPtr<CSSValue> createCSSImageValueWithReferrer(cons t AtomicString& rawValue, const CSSParserContext& context) 96 static PassRefPtrWillBeRawPtr<CSSValue> createCSSImageValueWithReferrer(cons t AtomicString& rawValue, const CSSParserContext& context)
97 { 97 {
98 RefPtrWillBeRawPtr<CSSValue> imageValue = CSSImageValue::create(rawValue , context.completeURL(rawValue)); 98 RefPtrWillBeRawPtr<CSSValue> imageValue = CSSImageValue::create(rawValue , context.completeURL(rawValue));
99 toCSSImageValue(imageValue.get())->setReferrer(context.referrer()); 99 toCSSImageValue(imageValue.get())->setReferrer(context.referrer());
100 return imageValue; 100 return imageValue;
101 } 101 }
102 102
103 // TODO(rwlbuis): move to CSSPropertyParser.cpp once CSSParserToken conversi on is done.
104 static bool isGeneratedImage(CSSValueID id)
105 {
106 return id == CSSValueLinearGradient || id == CSSValueRadialGradient
107 || id == CSSValueRepeatingLinearGradient || id == CSSValueRepeatingR adialGradient
108 || id == CSSValueWebkitLinearGradient || id == CSSValueWebkitRadialG radient
109 || id == CSSValueWebkitRepeatingLinearGradient || id == CSSValueWebk itRepeatingRadialGradient
110 || id == CSSValueWebkitGradient || id == CSSValueWebkitCrossFade;
111 }
112
103 private: 113 private:
104 CSSPropertyParser(const CSSParserTokenRange&, const CSSParserContext&, 114 CSSPropertyParser(const CSSParserTokenRange&, const CSSParserContext&,
105 WillBeHeapVector<CSSProperty, 256>&); 115 WillBeHeapVector<CSSProperty, 256>&);
106 116
107 // TODO(timloh): Rename once the CSSParserValue-based parseValue is removed 117 // TODO(timloh): Rename once the CSSParserValue-based parseValue is removed
108 bool parseValueStart(CSSPropertyID unresolvedProperty, bool important); 118 bool parseValueStart(CSSPropertyID unresolvedProperty, bool important);
109 bool consumeCSSWideKeyword(CSSPropertyID unresolvedProperty, bool important) ; 119 bool consumeCSSWideKeyword(CSSPropertyID unresolvedProperty, bool important) ;
110 PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID); 120 PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID);
111 121
112 bool parseValue(CSSPropertyID, bool important); 122 bool parseValue(CSSPropertyID, bool important);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 208
199 bool consumeBorderSpacing(bool important); 209 bool consumeBorderSpacing(bool important);
200 210
201 PassRefPtrWillBeRawPtr<CSSValue> parseCounterContent(CSSParserValueList* arg s, bool counters); 211 PassRefPtrWillBeRawPtr<CSSValue> parseCounterContent(CSSParserValueList* arg s, bool counters);
202 212
203 bool parseColorParameters(const CSSParserValue*, int* colorValues, bool pars eAlpha); 213 bool parseColorParameters(const CSSParserValue*, int* colorValues, bool pars eAlpha);
204 bool parseHSLParameters(const CSSParserValue*, double* colorValues, bool par seAlpha); 214 bool parseHSLParameters(const CSSParserValue*, double* colorValues, bool par seAlpha);
205 PassRefPtrWillBeRawPtr<CSSValue> parseColor(const CSSParserValue*, bool acce ptQuirkyColors = false); 215 PassRefPtrWillBeRawPtr<CSSValue> parseColor(const CSSParserValue*, bool acce ptQuirkyColors = false);
206 bool parseColorFromValue(const CSSParserValue*, RGBA32&, bool acceptQuirkyCo lors = false); 216 bool parseColorFromValue(const CSSParserValue*, RGBA32&, bool acceptQuirkyCo lors = false);
207 217
208 PassRefPtrWillBeRawPtr<CSSValueList> consumeFontFaceSrc();
209
210 // CSS3 Parsing Routines (for properties specific to CSS3) 218 // CSS3 Parsing Routines (for properties specific to CSS3)
211 bool parseBorderImageShorthand(CSSPropertyID, bool important); 219 bool parseBorderImageShorthand(CSSPropertyID, bool important);
212 PassRefPtrWillBeRawPtr<CSSValue> parseBorderImage(CSSPropertyID); 220 PassRefPtrWillBeRawPtr<CSSValue> parseBorderImage(CSSPropertyID);
213 bool parseBorderImageRepeat(RefPtrWillBeRawPtr<CSSValue>&); 221 bool parseBorderImageRepeat(RefPtrWillBeRawPtr<CSSValue>&);
214 bool parseBorderImageSlice(CSSPropertyID, RefPtrWillBeRawPtr<CSSBorderImageS liceValue>&); 222 bool parseBorderImageSlice(CSSPropertyID, RefPtrWillBeRawPtr<CSSBorderImageS liceValue>&);
215 bool parseBorderImageWidth(RefPtrWillBeRawPtr<CSSQuadValue>&); 223 bool parseBorderImageWidth(RefPtrWillBeRawPtr<CSSQuadValue>&);
216 bool parseBorderImageOutset(RefPtrWillBeRawPtr<CSSQuadValue>&); 224 bool parseBorderImageOutset(RefPtrWillBeRawPtr<CSSQuadValue>&);
217 bool parseBorderRadius(CSSPropertyID, bool important); 225 bool parseBorderRadius(CSSPropertyID, bool important);
218 226
219 PassRefPtrWillBeRawPtr<CSSValue> parseReflect(); 227 PassRefPtrWillBeRawPtr<CSSValue> parseReflect();
(...skipping 21 matching lines...) Expand all
241 bool parseCalculation(CSSParserValue*, ValueRange); 249 bool parseCalculation(CSSParserValue*, ValueRange);
242 250
243 bool parseGeneratedImage(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&) ; 251 bool parseGeneratedImage(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&) ;
244 252
245 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSPar serValue*); 253 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSPar serValue*);
246 PassRefPtrWillBeRawPtr<CSSStringValue> createPrimitiveStringValue(CSSParserV alue*); 254 PassRefPtrWillBeRawPtr<CSSStringValue> createPrimitiveStringValue(CSSParserV alue*);
247 PassRefPtrWillBeRawPtr<CSSCustomIdentValue> createPrimitiveCustomIdentValue( CSSParserValue*); 255 PassRefPtrWillBeRawPtr<CSSCustomIdentValue> createPrimitiveCustomIdentValue( CSSParserValue*);
248 256
249 PassRefPtrWillBeRawPtr<CSSBasicShapeInsetValue> parseInsetRoundedCorners(Pas sRefPtrWillBeRawPtr<CSSBasicShapeInsetValue>, CSSParserValueList*); 257 PassRefPtrWillBeRawPtr<CSSBasicShapeInsetValue> parseInsetRoundedCorners(Pas sRefPtrWillBeRawPtr<CSSBasicShapeInsetValue>, CSSParserValueList*);
250 258
251 PassRefPtrWillBeRawPtr<CSSValue> consumeFontFaceSrcURI();
252 PassRefPtrWillBeRawPtr<CSSValue> consumeFontFaceSrcLocal();
253
254 class ImplicitScope { 259 class ImplicitScope {
255 STACK_ALLOCATED(); 260 STACK_ALLOCATED();
256 WTF_MAKE_NONCOPYABLE(ImplicitScope); 261 WTF_MAKE_NONCOPYABLE(ImplicitScope);
257 public: 262 public:
258 ImplicitScope(CSSPropertyParser* parser) 263 ImplicitScope(CSSPropertyParser* parser)
259 : m_parser(parser) 264 : m_parser(parser)
260 { 265 {
261 m_parser->m_implicitShorthand = true; 266 m_parser->m_implicitShorthand = true;
262 } 267 }
263 268
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 bool m_implicitShorthand; 340 bool m_implicitShorthand;
336 RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation; 341 RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation;
337 }; 342 };
338 343
339 CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&); 344 CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&);
340 CSSValueID cssValueKeywordID(const CSSParserString&); 345 CSSValueID cssValueKeywordID(const CSSParserString&);
341 346
342 } // namespace blink 347 } // namespace blink
343 348
344 #endif // CSSPropertyParser_h 349 #endif // CSSPropertyParser_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698