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

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

Issue 1490883002: Move remaining independent transform properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 5 years 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 08f929151e0a64397a0c74b96f4b878620a964a9..fec9a497236d9d93f5b8453eb8943fb6cbf832e3 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1063,6 +1063,41 @@ static PassRefPtrWillBeRawPtr<CSSValueList> consumeRotation(CSSParserTokenRange&
return list.release();
}
+static PassRefPtrWillBeRawPtr<CSSValueList> consumeScale(CSSParserTokenRange& range, CSSParserMode cssParserMode)
+{
+ ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
+
+ RefPtrWillBeRawPtr<CSSValue> scale = consumeNumber(range, ValueRangeAll);
+ if (!scale)
+ return nullptr;
+ RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ list->append(scale.release());
+ if ((scale = consumeNumber(range, ValueRangeAll))) {
+ list->append(scale.release());
+ if ((scale = consumeNumber(range, ValueRangeAll)))
+ list->append(scale.release());
+ }
+
+ return list.release();
+}
+
+static PassRefPtrWillBeRawPtr<CSSValueList> consumeTranslate(CSSParserTokenRange& range, CSSParserMode cssParserMode)
+{
+ ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
+ RefPtrWillBeRawPtr<CSSValue> translate = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll);
+ if (!translate)
+ return nullptr;
+ RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ list->append(translate.release());
+ if ((translate = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll))) {
+ list->append(translate.release());
+ if ((translate = consumeLength(range, cssParserMode, ValueRangeAll)))
+ list->append(translate.release());
+ }
+
+ return list.release();
+}
+
static PassRefPtrWillBeRawPtr<CSSValue> consumeCounter(CSSParserTokenRange& range, CSSParserMode cssParserMode, int defaultValue)
{
if (range.peek().id() == CSSValueNone)
@@ -2137,6 +2172,10 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeLineHeight(m_range, m_context.mode());
case CSSPropertyRotate:
return consumeRotation(m_range, m_context.mode());
+ case CSSPropertyScale:
+ return consumeScale(m_range, m_context.mode());
+ case CSSPropertyTranslate:
+ return consumeTranslate(m_range, m_context.mode());
case CSSPropertyWebkitBorderHorizontalSpacing:
case CSSPropertyWebkitBorderVerticalSpacing:
return consumeLength(m_range, m_context.mode(), ValueRangeNonNegative);
« 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