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

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

Issue 1421533006: Make SVGLength wrap a CSSPrimitiveValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewable version Created 5 years, 2 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: third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
index 104d7188378d44a3a431d2982cfe8c09bc5db38c..03a604d25156a9d30850c8189330b39e0a6c86b1 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
@@ -110,9 +110,13 @@ static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleLengthValue(CSSPropertyID pro
if (unit == CSSPrimitiveValue::UnitType::Number) {
bool quirksMode = isQuirksModeBehavior(cssParserMode);
- if (number && !quirksMode)
+ bool svgMode = cssParserMode == SVGAttributeMode;
+ if (number && (!quirksMode && !svgMode))
return nullptr;
- unit = CSSPrimitiveValue::UnitType::Pixels;
+ if (svgMode)
+ unit = CSSPrimitiveValue::UnitType::UserCoordinates;
+ else
+ unit = CSSPrimitiveValue::UnitType::Pixels;
}
if (number < 0 && !acceptsNegativeNumbers)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698