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

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

Issue 1449803002: Move SVG paint/color properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« 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 564a3471f5154de3c3ad90d01fb2e8b41a701704..c71f77870d641e5d76a304c320cf887717bacad8 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1753,6 +1753,28 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeTransform(CSSParserTokenRange& ra
return list.release();
}
+static PassRefPtrWillBeRawPtr<CSSValue> consumePaint(CSSParserTokenRange& range, CSSParserContext context)
+{
+ if (range.peek().id() == CSSValueNone)
+ return consumeIdent(range);
+ String url = consumeUrl(range);
+ if (!url.isNull()) {
+ RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
+ if (range.peek().id() == CSSValueNone)
+ parsedValue = consumeIdent(range);
+ else
+ parsedValue = consumeColor(range, context);
+ if (parsedValue) {
+ RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
+ values->append(CSSURIValue::create(url));
+ values->append(parsedValue);
+ return values.release();
+ }
+ return CSSURIValue::create(url);
+ }
+ return consumeColor(range, context);
+}
+
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty)
{
CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
@@ -1863,6 +1885,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
case CSSPropertyWebkitBorderBeforeColor:
case CSSPropertyWebkitBorderAfterColor:
case CSSPropertyWebkitTextStrokeColor:
+ case CSSPropertyStopColor:
+ case CSSPropertyFloodColor:
+ case CSSPropertyLightingColor:
return consumeColor(m_range, m_context);
case CSSPropertyColor:
return consumeColor(m_range, m_context, inQuirksMode());
@@ -1901,6 +1926,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeLineWidth(m_range, m_context.mode());
case CSSPropertyTransform:
return consumeTransform(m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitTransform);
+ case CSSPropertyFill:
+ case CSSPropertyStroke:
+ return consumePaint(m_range, m_context);
default:
return nullptr;
}
« 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