Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp |
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp |
index 5e9b730d9e27584da2dcf0e9f6d4547c31b0075a..a537649d107d676895550b7b60416f49652fbe3f 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp |
@@ -313,6 +313,21 @@ CSSPrimitiveValue* consumeTime(CSSParserTokenRange& range, |
return nullptr; |
} |
+CSSPrimitiveValue* consumeResolution(CSSParserTokenRange& range) { |
+ const CSSParserToken& token = range.peek(); |
+ // Unlike the other types, calc() does not work with <resolution>. |
+ if (token.type() != DimensionToken) |
+ return nullptr; |
+ CSSPrimitiveValue::UnitType unit = token.unitType(); |
+ if (unit == CSSPrimitiveValue::UnitType::DotsPerPixel || |
+ unit == CSSPrimitiveValue::UnitType::DotsPerInch || |
+ unit == CSSPrimitiveValue::UnitType::DotsPerCentimeter) { |
+ return CSSPrimitiveValue::create( |
+ range.consumeIncludingWhitespace().numericValue(), unit); |
+ } |
+ return nullptr; |
+} |
+ |
CSSIdentifierValue* consumeIdent(CSSParserTokenRange& range) { |
if (range.peek().type() != IdentToken) |
return nullptr; |