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

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

Issue 1319343004: Add property parser code path based on CSSParserTokenRange (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests Created 5 years, 3 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 /* 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 21 matching lines...) Expand all
32 32
33 class BorderImageParseContext; 33 class BorderImageParseContext;
34 class CSSBorderImageSliceValue; 34 class CSSBorderImageSliceValue;
35 class CSSBasicShape; 35 class CSSBasicShape;
36 class CSSBasicShapeInset; 36 class CSSBasicShapeInset;
37 class CSSFunctionValue; 37 class CSSFunctionValue;
38 class CSSGradientValue; 38 class CSSGradientValue;
39 class CSSGridLineNamesValue; 39 class CSSGridLineNamesValue;
40 class CSSLineBoxContainValue; 40 class CSSLineBoxContainValue;
41 struct CSSParserString; 41 struct CSSParserString;
42 class CSSParserTokenRange;
42 struct CSSParserValue; 43 struct CSSParserValue;
43 class CSSParserValueList; 44 class CSSParserValueList;
44 class CSSPrimitiveValue; 45 class CSSPrimitiveValue;
45 class CSSProperty; 46 class CSSProperty;
46 class CSSQuadValue; 47 class CSSQuadValue;
47 class CSSValue; 48 class CSSValue;
48 class CSSValueList; 49 class CSSValueList;
49 class StylePropertyShorthand; 50 class StylePropertyShorthand;
50 51
51 // Inputs: PropertyID, isImportant bool, CSSParserValueList. 52 // Inputs: PropertyID, isImportant bool, CSSParserValueList.
(...skipping 13 matching lines...) Expand all
65 FTime = 0x0020, 66 FTime = 0x0020,
66 FFrequency = 0x0040, 67 FFrequency = 0x0040,
67 FPositiveInteger = 0x0080, 68 FPositiveInteger = 0x0080,
68 FRelative = 0x0100, 69 FRelative = 0x0100,
69 FResolution = 0x0200, 70 FResolution = 0x0200,
70 FNonNeg = 0x0400, 71 FNonNeg = 0x0400,
71 FUnitlessQuirk = 0x0800 72 FUnitlessQuirk = 0x0800
72 }; 73 };
73 74
74 static bool parseValue(CSSPropertyID, bool important, 75 static bool parseValue(CSSPropertyID, bool important,
75 CSSParserValueList*, const CSSParserContext&, 76 CSSParserValueList*, CSSParserTokenRange*, const CSSParserContext&,
76 WillBeHeapVector<CSSProperty, 256>&, StyleRule::Type); 77 WillBeHeapVector<CSSProperty, 256>&, StyleRule::Type);
77 78
78 static bool isSystemColor(CSSValueID); 79 static bool isSystemColor(CSSValueID);
79 static bool isColorKeyword(CSSValueID); 80 static bool isColorKeyword(CSSValueID);
80 81
81 private: 82 private:
82 CSSPropertyParser(CSSParserValueList*, const CSSParserContext&, 83 CSSPropertyParser(CSSParserValueList*, const CSSParserContext&,
83 WillBeHeapVector<CSSProperty, 256>&, StyleRule::Type); 84 WillBeHeapVector<CSSProperty, 256>&, StyleRule::Type);
84 85
85 bool parseValue(CSSPropertyID, bool important); 86 bool parseValue(CSSPropertyID, bool important);
87 PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID);
86 88
87 bool inShorthand() const { return m_inParseShorthand; } 89 bool inShorthand() const { return m_inParseShorthand; }
88 bool inQuirksMode() const { return isQuirksModeBehavior(m_context.mode()); } 90 bool inQuirksMode() const { return isQuirksModeBehavior(m_context.mode()); }
89 91
90 bool parseViewportProperty(CSSPropertyID propId, bool important); 92 bool parseViewportProperty(CSSPropertyID propId, bool important);
91 bool parseViewportShorthand(CSSPropertyID propId, CSSPropertyID first, CSSPr opertyID second, bool important); 93 bool parseViewportShorthand(CSSPropertyID propId, CSSPropertyID first, CSSPr opertyID second, bool important);
92 bool parseFontFaceDescriptor(CSSPropertyID); 94 bool parseFontFaceDescriptor(CSSPropertyID);
93 95
94 KURL completeURL(const String& url) const; 96 KURL completeURL(const String& url) const;
95 97
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 void commitBorderImageProperty(CSSPropertyID, PassRefPtrWillBeRawPtr<CSSValu e>, bool important); 361 void commitBorderImageProperty(CSSPropertyID, PassRefPtrWillBeRawPtr<CSSValu e>, bool important);
360 362
361 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapPoints(); 363 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapPoints();
362 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapDestination(); 364 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapDestination();
363 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapCoordinate(); 365 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapCoordinate();
364 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapPosition(); 366 PassRefPtrWillBeRawPtr<CSSValue> parseScrollSnapPosition();
365 367
366 private: 368 private:
367 // Inputs: 369 // Inputs:
368 CSSParserValueList* m_valueList; 370 CSSParserValueList* m_valueList;
371 CSSParserTokenRange* m_range;
369 const CSSParserContext& m_context; 372 const CSSParserContext& m_context;
370 373
371 // Outputs: 374 // Outputs:
372 WillBeHeapVector<CSSProperty, 256>& m_parsedProperties; 375 WillBeHeapVector<CSSProperty, 256>& m_parsedProperties;
373 StyleRule::Type m_ruleType; 376 StyleRule::Type m_ruleType;
374 377
375 // Locals during parsing: 378 // Locals during parsing:
376 int m_inParseShorthand; 379 int m_inParseShorthand;
377 CSSPropertyID m_currentShorthand; 380 CSSPropertyID m_currentShorthand;
378 bool m_implicitShorthand; 381 bool m_implicitShorthand;
379 RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation; 382 RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation;
380 }; 383 };
381 384
382 CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&); 385 CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&);
383 CSSValueID cssValueKeywordID(const CSSParserString&); 386 CSSValueID cssValueKeywordID(const CSSParserString&);
384 387
385 } // namespace blink 388 } // namespace blink
386 389
387 #endif // CSSPropertyParser_h 390 #endif // CSSPropertyParser_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698