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

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

Issue 1406423003: Move zoom property handling into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2dc793dc3d177380ff72bd028152bf0da03912cd..0a907e68f2122f704ee0b1d74e3a84486f5147ea 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -939,6 +939,26 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeColumnSpan(CSSParserTokenRange& r
return nullptr;
}
+static PassRefPtrWillBeRawPtr<CSSValue> consumeZoom(CSSParserTokenRange& range, const CSSParserContext& context)
+{
+ const CSSParserToken& token = range.peek();
+ CSSValueID id = token.id();
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> zoom;
+ if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocument) {
+ zoom = consumeIdent(range);
+ } else {
+ zoom = consumePercent(range, ValueRangeNonNegative);
+ if (!zoom)
+ zoom = consumeNumber(range, ValueRangeNonNegative);
+ }
+ if (zoom && context.useCounter()
+ && !(id == CSSValueNormal
+ || (token.type() == NumberToken && zoom->getDoubleValue() == 1)
+ || (token.type() == PercentageToken && zoom->getDoubleValue() == 100)))
+ context.useCounter()->count(UseCounter::CSSZoomNotEqualToOne);
+ return zoom.release();
+}
+
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID propId)
{
m_range.consumeWhitespace();
@@ -1017,6 +1037,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeColumnGap(m_range, m_context.mode());
case CSSPropertyWebkitColumnSpan:
return consumeColumnSpan(m_range, m_context.mode());
+ case CSSPropertyZoom:
+ return consumeZoom(m_range, m_context);
default:
return nullptr;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698