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

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: CSSPropertyParser Created 5 years, 1 month 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 6d18201b504e90b23a39fa769695d0c891aee793..8a06a16ba5efaff97200daab038d53e1aa01945f 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1947,6 +1947,18 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeStrokeDasharray(CSSParserTokenRan
return dashes.release();
}
+static PassRefPtrWillBeRawPtr<CSSValue> consumeSVGDPath(CSSParserTokenRange& range)
fs 2015/11/26 12:51:39 Shouldn't the syntax for this be the same as for m
Eric Willigers 2015/12/10 23:52:52 Done. Should we have None or path('') if the eleme
fs 2015/12/11 13:01:58 The way you've done it in the latest PS seems ok t
+{
+ if (range.peek().type() != StringToken)
+ return nullptr;
+
+ String pathString = range.consumeIncludingWhitespace().value();
+ Path path;
+ if (!buildPathFromString(pathString, path) || !range.atEnd())
fs 2015/11/26 12:51:39 Here we build a Path (not entirely free) just to t
fs 2015/12/11 13:01:58 Just noting: We should probably make sure this is
Eric Willigers 2015/12/14 05:36:46 The implemented approach is conservative, and cons
+ return nullptr;
+ return CSSStringValue::create(pathString);
+}
+
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty)
{
CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
@@ -2130,6 +2142,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeNumber(m_range, ValueRangeNonNegative);
case CSSPropertyStrokeDasharray:
return consumeStrokeDasharray(m_range);
+ case CSSPropertyD:
+ return consumeSVGDPath(m_range);
default:
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698