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

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

Issue 2247773004: [WIP] CSS Motion Path: offset-anchor and offset-position Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: offsetAnchor Created 4 years, 4 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
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 6ad5b1c4e2d4b13fed9eaac5c9cba9fc914378b1..9129f849c0709af9a5b6c1e37c4a4e68c5f5d52b 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1528,7 +1528,7 @@ static CSSValue* consumePathOrNone(CSSParserTokenRange& range)
return consumePath(range);
}
-static CSSValue* consumeMotionRotation(CSSParserTokenRange& range)
+static CSSValue* consumeOffsetRotation(CSSParserTokenRange& range)
{
CSSValue* angle = consumeAngle(range);
CSSValue* keyword = consumeIdent<CSSValueAuto, CSSValueReverse>(range);
@@ -1546,6 +1546,14 @@ static CSSValue* consumeMotionRotation(CSSParserTokenRange& range)
return list;
}
+CSSValue* consumeOffsetPosition(CSSParserTokenRange& range, CSSParserMode cssParserMode)
+{
+ CSSValueID id = range.peek().id();
+ if (id == CSSValueAuto)
+ return consumeIdent(range);
+ return consumePosition(range, cssParserMode, UnitlessQuirk::Forbid);
+}
+
static CSSValue* consumeTextEmphasisStyle(CSSParserTokenRange& range)
{
CSSValueID id = range.peek().id();
@@ -3208,6 +3216,9 @@ const CSSValue* CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProp
case CSSPropertyObjectPosition:
case CSSPropertyPerspectiveOrigin:
return consumePosition(m_range, m_context.mode(), UnitlessQuirk::Forbid);
+ case CSSPropertyOffsetAnchor:
+ case CSSPropertyOffsetPosition:
+ return consumeOffsetPosition(m_range, m_context.mode());
case CSSPropertyWebkitLineClamp:
return consumeLineClamp(m_range);
case CSSPropertyWebkitFontSizeDelta:
@@ -3307,12 +3318,12 @@ const CSSValue* CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProp
case CSSPropertyTextDecorationLine:
return consumeTextDecorationLine(m_range);
case CSSPropertyD:
- case CSSPropertyMotionPath:
+ case CSSPropertyOffsetPath:
return consumePathOrNone(m_range);
- case CSSPropertyMotionOffset:
+ case CSSPropertyOffsetDistance:
return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeAll);
- case CSSPropertyMotionRotation:
- return consumeMotionRotation(m_range);
+ case CSSPropertyOffsetRotation:
+ return consumeOffsetRotation(m_range);
case CSSPropertyWebkitTextEmphasisStyle:
return consumeTextEmphasisStyle(m_range);
case CSSPropertyOutlineColor:
@@ -4241,10 +4252,8 @@ bool CSSPropertyParser::consumeBackgroundShorthand(const StylePropertyShorthand&
if (property == CSSPropertyBackgroundRepeatX || property == CSSPropertyWebkitMaskRepeatX) {
consumeRepeatStyleComponent(m_range, value, valueY, implicit);
} else if (property == CSSPropertyBackgroundPositionX || property == CSSPropertyWebkitMaskPositionX) {
- CSSParserTokenRange rangeCopy = m_range;
- if (!consumePosition(rangeCopy, m_context.mode(), UnitlessQuirk::Forbid, value, valueY))
+ if (!consumePosition(m_range, m_context.mode(), UnitlessQuirk::Forbid, value, valueY))
continue;
- m_range = rangeCopy;
} else if (property == CSSPropertyBackgroundSize || property == CSSPropertyWebkitMaskSize) {
if (!consumeSlashIncludingWhitespace(m_range))
continue;
@@ -4586,6 +4595,8 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im
return consume4Values(paddingShorthand(), important);
case CSSPropertyMotion:
return consumeShorthandGreedily(motionShorthand(), important);
+ case CSSPropertyOffset:
+ return consumeShorthandGreedily(offsetShorthand(), important);
case CSSPropertyWebkitTextEmphasis:
return consumeShorthandGreedily(webkitTextEmphasisShorthand(), important);
case CSSPropertyOutline:

Powered by Google App Engine
This is Rietveld 408576698