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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 1421533006: Make SVGLength wrap a CSSPrimitiveValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added expectation Created 5 years, 1 month 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: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index c950d18cfd67fe13205178486dd22fef3104b2b3..2ea556f9335c6859fc11ec056f05bce1dfe7d584 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -278,6 +278,7 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLength(CSSParserTokenRan
case CSSPrimitiveValue::UnitType::Inches:
case CSSPrimitiveValue::UnitType::Points:
case CSSPrimitiveValue::UnitType::Picas:
+ case CSSPrimitiveValue::UnitType::UserUnits:
case CSSPrimitiveValue::UnitType::ViewportWidth:
case CSSPrimitiveValue::UnitType::ViewportHeight:
case CSSPrimitiveValue::UnitType::ViewportMin:
@@ -294,7 +295,10 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLength(CSSParserTokenRan
if (!shouldAcceptUnitlessValues(token.numericValue(), cssParserMode, unitless)
|| (valueRange == ValueRangeNonNegative && token.numericValue() < 0))
return nullptr;
- return cssValuePool().createValue(range.consumeIncludingWhitespace().numericValue(), CSSPrimitiveValue::UnitType::Pixels);
+ CSSPrimitiveValue::UnitType unitType = CSSPrimitiveValue::UnitType::Pixels;
+ if (cssParserMode == SVGAttributeMode)
+ unitType = CSSPrimitiveValue::UnitType::UserUnits;
+ return cssValuePool().createValue(range.consumeIncludingWhitespace().numericValue(), unitType);
}
CalcParser calcParser(range, valueRange);
if (calcParser.value() && calcParser.value()->category() == CalcLength)

Powered by Google App Engine
This is Rietveld 408576698