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

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

Issue 1439793003: SVG: Promote d to a property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DECLARE_VIRTUAL_TRACE 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
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 6432b846e62d74e23d9fd369d8c4ff6327c26caa..aff2beb57587228980e50f61fdb42c18a2cd3338 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1926,11 +1926,8 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeContain(CSSParserTokenRange& rang
return list.release();
}
-static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionPath(CSSParserTokenRange& range)
+static PassRefPtrWillBeRawPtr<CSSValue> consumePath(CSSParserTokenRange& range)
{
- CSSValueID id = range.peek().id();
- if (id == CSSValueNone)
- return consumeIdent(range);
// FIXME: Add support for <url>, <basic-shape>, <geometry-box>.
if (range.peek().functionId() != CSSValuePath)
return nullptr;
@@ -1942,12 +1939,22 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionPath(CSSParserTokenRange& r
if (functionArgs.peek().type() != StringToken)
return nullptr;
String pathString = functionArgs.consumeIncludingWhitespace().value();
- Path path;
- if (!buildPathFromString(pathString, path) || !functionArgs.atEnd())
+
+ OwnPtr<SVGPathByteStream> byteStream = SVGPathByteStream::create();
+ if (!buildByteStreamFromString(pathString, *byteStream) || !functionArgs.atEnd())
return nullptr;
range = functionRange;
- return CSSPathValue::create(pathString);
+ return CSSPathValue::create(byteStream.release());
+}
+
+static PassRefPtrWillBeRawPtr<CSSValue> consumePathOrNone(CSSParserTokenRange& range)
+{
+ CSSValueID id = range.peek().id();
+ if (id == CSSValueNone)
+ return consumeIdent(range);
+
+ return consumePath(range);
}
static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionRotation(CSSParserTokenRange& range, CSSParserMode cssParserMode)
@@ -2786,8 +2793,10 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
case CSSPropertyWebkitTextDecorationsInEffect:
case CSSPropertyTextDecorationLine:
return consumeTextDecorationLine(m_range);
+ case CSSPropertyD:
+ return consumePath(m_range);
case CSSPropertyMotionPath:
- return consumeMotionPath(m_range);
+ return consumePathOrNone(m_range);
case CSSPropertyMotionOffset:
return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeAll);
case CSSPropertyMotionRotation:

Powered by Google App Engine
This is Rietveld 408576698