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

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

Issue 1475903002: Don't handle unitless length quirk in CSS parser fast path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/css-parser/unitless-length-quirk.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f8bd98e37ec7dd37955f335aff42f375e53808f1..d1206ece38309489c1c8fb82254af83841625833 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
@@ -109,15 +109,14 @@ static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleLengthValue(CSSPropertyID pro
}
if (unit == CSSPrimitiveValue::UnitType::Number) {
- bool quirksMode = isQuirksModeBehavior(cssParserMode);
- bool svgMode = cssParserMode == SVGAttributeMode;
- if (number && (!quirksMode && !svgMode))
- return nullptr;
- if (svgMode)
+ if (cssParserMode == SVGAttributeMode)
unit = CSSPrimitiveValue::UnitType::UserUnits;
- else
+ else if (!number)
unit = CSSPrimitiveValue::UnitType::Pixels;
+ else
+ return nullptr;
}
+
if (number < 0 && !acceptsNegativeNumbers)
return nullptr;
« no previous file with comments | « third_party/WebKit/LayoutTests/css-parser/unitless-length-quirk.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698