Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h |
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h |
index 51de867250fb3d9bf5e3dc78707d6b772546932c..f6633215c252a93248a416086dfd10a596b5830e 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h |
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h |
@@ -192,6 +192,9 @@ private: |
bool parseSystemFont(bool important); |
PassRefPtrWillBeRawPtr<CSSValueList> parseFontFamily(); |
+ PassRefPtrWillBeRawPtr<CSSValue> consumeSpacing(); |
+ PassRefPtrWillBeRawPtr<CSSValue> consumeTabSize(); |
+ |
PassRefPtrWillBeRawPtr<CSSValue> parseCounter(int defaultValue); |
PassRefPtrWillBeRawPtr<CSSValue> parseCounterContent(CSSParserValueList* args, bool counters); |
@@ -340,8 +343,6 @@ private: |
bool validCalculationUnit(CSSParserValue*, Units, ReleaseParsedCalcValueCondition releaseCalc = DoNotReleaseParsedCalcValue); |
- bool shouldAcceptUnitLessValues(CSSParserValue*, Units, CSSParserMode); |
- |
inline bool validUnit(CSSParserValue* value, Units unitflags, ReleaseParsedCalcValueCondition releaseCalc = DoNotReleaseParsedCalcValue) { return validUnit(value, unitflags, m_context.mode(), releaseCalc); } |
bool validUnit(CSSParserValue*, Units, CSSParserMode, ReleaseParsedCalcValueCondition releaseCalc = DoNotReleaseParsedCalcValue); |
@@ -377,6 +378,15 @@ private: |
RefPtrWillBeMember<CSSCalcValue> m_parsedCalculation; |
}; |
+inline bool shouldAcceptUnitLessValues(double fValue, CSSPropertyParser::Units unitflags, CSSParserMode cssParserMode) |
+{ |
+ // Quirks mode for certain properties and presentation attributes accept unit-less values for certain units. |
+ return (unitflags & (CSSPropertyParser::FLength | CSSPropertyParser::FAngle)) |
+ && (!fValue // 0 can always be unitless. |
+ || isUnitLessLengthParsingEnabledForMode(cssParserMode) // HTML and SVG attribute values can always be unitless. |
+ || (cssParserMode == HTMLQuirksMode && (unitflags & CSSPropertyParser::FUnitlessQuirk))); |
+} |
+ |
CSSPropertyID unresolvedCSSPropertyID(const CSSParserString&); |
CSSValueID cssValueKeywordID(const CSSParserString&); |