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

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: RefPtrWillBePersistent 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 6e2b2211d22e2763058d7ae3233c3358c86d817f..56ca97b4ce703d1c71d90315b9e3be4f9c399bab 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1925,10 +1925,10 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeContain(CSSParserTokenRange& rang
return list.release();
}
-static PassRefPtrWillBeRawPtr<CSSValue> consumeMotionPath(CSSParserTokenRange& range)
+static PassRefPtrWillBeRawPtr<CSSValue> consumePath(CSSParserTokenRange& range, CSSPropertyID property)
{
CSSValueID id = range.peek().id();
- if (id == CSSValueNone)
+ if (id == CSSValueNone && property == CSSPropertyMotionPath)
fs 2015/12/11 13:01:58 Suggestion: Could also do the trivial split - cons
return consumeIdent(range);
// FIXME: Add support for <url>, <basic-shape>, <geometry-box>.
if (range.peek().functionId() != CSSValuePath)
@@ -1941,12 +1941,13 @@ 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> consumeMotionRotation(CSSParserTokenRange& range, CSSParserMode cssParserMode)
@@ -2574,8 +2575,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
case CSSPropertyWebkitTextDecorationsInEffect:
case CSSPropertyTextDecorationLine:
return consumeTextDecorationLine(m_range);
+ case CSSPropertyD:
case CSSPropertyMotionPath:
- return consumeMotionPath(m_range);
+ return consumePath(m_range, property);
case CSSPropertyMotionOffset:
return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeAll);
case CSSPropertyMotionRotation:

Powered by Google App Engine
This is Rietveld 408576698