| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, CSSValue, bool important, bool implicit = fa
lse); | 95 void addProperty(CSSPropertyID, const CSSValue&, bool important, bool implic
it = false); |
| 96 void rollbackLastProperties(int num); | 96 void rollbackLastProperties(int num); |
| 97 void addExpandedPropertyForValue(CSSPropertyID propId, CSSValue, bool); | 97 void addExpandedPropertyForValue(CSSPropertyID propId, CSSValue, bool); |
| 98 | 98 |
| 99 NullableCSSValue parseValidPrimitive(CSSValueID ident, CSSParserValue*); | 99 NullableCSSValue parseValidPrimitive(CSSValueID ident, CSSParserValue*); |
| 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 PassRefPtrWillBeRawPtr<CSSValueList> parseContent(); |
| 104 NullableCSSValue parseQuotes(); | 104 NullableCSSValue parseQuotes(); |
| 105 | 105 |
| 106 NullableCSSValue parseAttr(CSSParserValueList* args); | 106 NullableCSSValue parseAttr(CSSParserValueList* args); |
| 107 | 107 |
| 108 bool parseFillImage(CSSParserValueList*, NullableCSSValue&); | 108 bool parseFillImage(CSSParserValueList*, NullableCSSValue&); |
| 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 NullableCSSValue parseFillPositionComponent(CSSParserValueList*, unsigned& c
umulativeFlags, FillPositionFlag& individualFlag, FillPositionParsingMode = Reso
lveValuesAsPercent, Units = FUnknown); | 112 NullableCSSValue parseFillPositionComponent(CSSParserValueList*, unsigned& c
umulativeFlags, FillPositionFlag& individualFlag, FillPositionParsingMode = Reso
lveValuesAsPercent, Units = FUnknown); |
| 113 NullableCSSValue parseFillPositionX(CSSParserValueList*); | 113 NullableCSSValue parseFillPositionX(CSSParserValueList*); |
| 114 NullableCSSValue parseFillPositionY(CSSParserValueList*); | 114 NullableCSSValue parseFillPositionY(CSSParserValueList*); |
| 115 void parse2ValuesFillPosition(CSSParserValueList*, NullableCSSValue&, Nullab
leCSSValue&, Units = FUnknown); | 115 void parse2ValuesFillPosition(CSSParserValueList*, NullableCSSValue&, Nullab
leCSSValue&, Units = FUnknown); |
| 116 bool isPotentialPositionValue(CSSParserValue*); | 116 bool isPotentialPositionValue(CSSParserValue*); |
| 117 void parseFillPosition(CSSParserValueList*, NullableCSSValue&, NullableCSSVa
lue&, Units = FUnknown); | 117 void parseFillPosition(CSSParserValueList*, NullableCSSValue&, NullableCSSVa
lue&, Units = FUnknown); |
| 118 void parse3ValuesFillPosition(CSSParserValueList*, NullableCSSValue&, Nullab
leCSSValue&, CSSPrimitiveValue, CSSPrimitiveValue); | 118 void parse3ValuesFillPosition(CSSParserValueList*, NullableCSSValue&, Nullab
leCSSValue&, const CSSPrimitiveValue&, const CSSPrimitiveValue&); |
| 119 void parse4ValuesFillPosition(CSSParserValueList*, NullableCSSValue&, Nullab
leCSSValue&, CSSPrimitiveValue, CSSPrimitiveValue); | 119 void parse4ValuesFillPosition(CSSParserValueList*, NullableCSSValue&, Nullab
leCSSValue&, const CSSPrimitiveValue&, const CSSPrimitiveValue&); |
| 120 | 120 |
| 121 void parseFillRepeat(NullableCSSValue&, NullableCSSValue&); | 121 void parseFillRepeat(NullableCSSValue&, NullableCSSValue&); |
| 122 NullableCSSValue parseFillSize(CSSPropertyID); | 122 NullableCSSValue parseFillSize(CSSPropertyID); |
| 123 | 123 |
| 124 bool parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1, CSSProp
ertyID& propId2, NullableCSSValue&, NullableCSSValue&); | 124 bool parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1, CSSProp
ertyID& propId2, NullableCSSValue&, NullableCSSValue&); |
| 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(NullableCSSValue& lval, CSSValue rval); | 127 void addFillValue(NullableCSSValue& lval, const CSSValue& rval); |
| 128 | 128 |
| 129 NullableCSSValue parseAnimationDelay(); | 129 NullableCSSValue parseAnimationDelay(); |
| 130 NullableCSSValue parseAnimationDirection(); | 130 NullableCSSValue parseAnimationDirection(); |
| 131 NullableCSSValue parseAnimationDuration(); | 131 NullableCSSValue parseAnimationDuration(); |
| 132 NullableCSSValue parseAnimationFillMode(); | 132 NullableCSSValue parseAnimationFillMode(); |
| 133 NullableCSSValue parseAnimationIterationCount(); | 133 NullableCSSValue parseAnimationIterationCount(); |
| 134 NullableCSSValue parseAnimationName(bool allowQuotedName); | 134 NullableCSSValue parseAnimationName(bool allowQuotedName); |
| 135 NullableCSSValue parseAnimationPlayState(); | 135 NullableCSSValue parseAnimationPlayState(); |
| 136 NullableCSSValue parseAnimationProperty(); | 136 NullableCSSValue parseAnimationProperty(); |
| 137 NullableCSSValue parseAnimationTimingFunction(); | 137 NullableCSSValue parseAnimationTimingFunction(); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 bool validUnit(CSSParserValue*, Units, CSSParserMode, ReleaseParsedCalcValue
Condition releaseCalc = DoNotReleaseParsedCalcValue); | 354 bool validUnit(CSSParserValue*, Units, CSSParserMode, ReleaseParsedCalcValue
Condition releaseCalc = DoNotReleaseParsedCalcValue); |
| 355 | 355 |
| 356 bool parseBorderImageQuad(Units, NullableCSSValue&); | 356 bool parseBorderImageQuad(Units, NullableCSSValue&); |
| 357 int colorIntFromValue(CSSParserValue*); | 357 int colorIntFromValue(CSSParserValue*); |
| 358 bool isCalculation(CSSParserValue*); | 358 bool isCalculation(CSSParserValue*); |
| 359 | 359 |
| 360 bool buildBorderImageParseContext(CSSPropertyID, BorderImageParseContext&); | 360 bool buildBorderImageParseContext(CSSPropertyID, BorderImageParseContext&); |
| 361 | 361 |
| 362 bool parseDeprecatedGradientColorStop(CSSParserValue*, CSSGradientColorStop&
); | 362 bool parseDeprecatedGradientColorStop(CSSParserValue*, CSSGradientColorStop&
); |
| 363 | 363 |
| 364 void commitBorderImageProperty(CSSPropertyID, NullableCSSValue, bool importa
nt); | 364 void commitBorderImageProperty(CSSPropertyID, const NullableCSSValue&, bool
important); |
| 365 | 365 |
| 366 NullableCSSValue parseScrollSnapPoints(); | 366 NullableCSSValue parseScrollSnapPoints(); |
| 367 NullableCSSValue parseScrollSnapDestination(); | 367 NullableCSSValue parseScrollSnapDestination(); |
| 368 NullableCSSValue parseScrollSnapCoordinate(); | 368 NullableCSSValue parseScrollSnapCoordinate(); |
| 369 NullableCSSValue parseScrollSnapPosition(); | 369 NullableCSSValue parseScrollSnapPosition(); |
| 370 | 370 |
| 371 private: | 371 private: |
| 372 // Inputs: | 372 // Inputs: |
| 373 CSSParserValueList* m_valueList; | 373 CSSParserValueList* m_valueList; |
| 374 const CSSParserContext& m_context; | 374 const CSSParserContext& m_context; |
| 375 | 375 |
| 376 // Outputs: | 376 // Outputs: |
| 377 WillBeHeapVector<CSSProperty, 256>& m_parsedProperties; | 377 WillBeHeapVector<CSSProperty, 256>& m_parsedProperties; |
| 378 StyleRule::Type m_ruleType; | 378 StyleRule::Type m_ruleType; |
| 379 | 379 |
| 380 // Locals during parsing: | 380 // Locals during parsing: |
| 381 int m_inParseShorthand; | 381 int m_inParseShorthand; |
| 382 CSSPropertyID m_currentShorthand; | 382 CSSPropertyID m_currentShorthand; |
| 383 bool m_implicitShorthand; | 383 bool m_implicitShorthand; |
| 384 RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation; | 384 RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation; |
| 385 }; | 385 }; |
| 386 | 386 |
| 387 CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&); | 387 CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&); |
| 388 CSSValueID cssValueKeywordID(const CSSParserString&); | 388 CSSValueID cssValueKeywordID(const CSSParserString&); |
| 389 | 389 |
| 390 } // namespace blink | 390 } // namespace blink |
| 391 | 391 |
| 392 #endif // CSSPropertyParser_h | 392 #endif // CSSPropertyParser_h |
| OLD | NEW |