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

Unified Diff: Source/core/css/parser/LegacyCSSPropertyParser.cpp

Issue 1348363004: Add consumeInteger/consumeLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix build 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/parser/LegacyCSSPropertyParser.cpp
diff --git a/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/Source/core/css/parser/LegacyCSSPropertyParser.cpp
index c1db97307fa86555fd028a7472406937246e552e..734b7774eaf7d500797d1015ecaf09470a7b377a 100644
--- a/Source/core/css/parser/LegacyCSSPropertyParser.cpp
+++ b/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -173,15 +173,6 @@ bool CSSPropertyParser::validCalculationUnit(CSSParserValue* value, Units unitfl
return b;
}
-inline bool CSSPropertyParser::shouldAcceptUnitLessValues(CSSParserValue* value, Units unitflags, CSSParserMode cssParserMode)
-{
- // Quirks mode for certain properties and presentation attributes accept unit-less values for certain units.
- return (unitflags & (FLength | FAngle))
- && (!value->fValue // 0 can always be unitless.
- || isUnitLessLengthParsingEnabledForMode(cssParserMode) // HTML and SVG attribute values can always be unitless.
- || (cssParserMode == HTMLQuirksMode && (unitflags & FUnitlessQuirk)));
-}
-
inline bool isCalculation(CSSParserValue* value)
{
return value->m_unit == CSSParserValue::CalcFunction;
@@ -198,7 +189,7 @@ bool CSSPropertyParser::validUnit(CSSParserValue* value, Units unitflags, CSSPar
case CSSPrimitiveValue::UnitType::Number:
if (unitflags & FNumber)
return true;
- if (shouldAcceptUnitLessValues(value, unitflags, cssParserMode)) {
+ if (shouldAcceptUnitLessValues(value->fValue, unitflags, cssParserMode)) {
value->setUnit((unitflags & FLength) ? CSSPrimitiveValue::UnitType::Pixels : CSSPrimitiveValue::UnitType::Degrees);
return true;
}
@@ -697,14 +688,6 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
validPrimitive = validUnit(value, FLength | FNonNeg | unitless);
break;
- case CSSPropertyLetterSpacing: // normal | <length> | inherit
- case CSSPropertyWordSpacing: // normal | <length> | inherit
- if (id == CSSValueNormal)
- validPrimitive = true;
- else
- validPrimitive = validUnit(value, FLength | FUnitlessQuirk);
- break;
-
case CSSPropertyTextIndent:
parsedValue = parseTextIndent();
break;
@@ -1442,6 +1425,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
case CSSPropertyQuotes:
case CSSPropertyWebkitHighlight:
case CSSPropertyFontVariantLigatures:
+ case CSSPropertyLetterSpacing:
+ case CSSPropertyWordSpacing:
+
validPrimitive = false;
break;
« Source/core/css/parser/CSSPropertyParser.cpp ('K') | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698