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

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: 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/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 3b0046797503e6ed25a99da55128fd4ba6545c6c..f84f25d4bb463be3fe46307d06d37eacb3d0e6fa 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::UserUnits;
+ else
+ unit = CSSPrimitiveValue::UnitType::Pixels;
}
if (number < 0 && !acceptsNegativeNumbers)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698