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

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

Issue 1447173002: Parse marker shorthand in CSSPropertyParser with CSSParserTokens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove more cases 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 05d164421a65ccafbb6d5036b67afaaba731bdd6..24d921b83e4f4dddf24cbebe569ba44009e0c887 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1825,6 +1825,17 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumePaintOrder(CSSParserTokenRange& r
return paintOrderList.release();
}
+static PassRefPtrWillBeRawPtr<CSSValue> consumeNoneOrURI(CSSParserTokenRange& range)
+{
+ if (range.peek().id() == CSSValueNone)
+ return consumeIdent(range);
+
+ String url = consumeUrl(range);
+ if (url.isNull())
+ return nullptr;
+ return CSSURIValue::create(url);
+}
+
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty)
{
CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
@@ -1981,6 +1992,10 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumePaint(m_range, m_context);
case CSSPropertyPaintOrder:
return consumePaintOrder(m_range);
+ case CSSPropertyMarkerStart:
+ case CSSPropertyMarkerMid:
+ case CSSPropertyMarkerEnd:
+ return consumeNoneOrURI(m_range);
default:
return nullptr;
}
@@ -2471,6 +2486,16 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im
return consumeShorthandGreedily(webkitBorderAfterShorthand(), important);
case CSSPropertyWebkitTextStroke:
return consumeShorthandGreedily(webkitTextStrokeShorthand(), important);
+ case CSSPropertyMarker: {
+ ImplicitScope implicitScope(this);
+ RefPtrWillBeRawPtr<CSSValue> marker = parseSingleValue(CSSPropertyMarkerStart);
+ if (!marker || !m_range.atEnd())
+ return false;
+ addProperty(CSSPropertyMarkerStart, marker, important);
+ addProperty(CSSPropertyMarkerMid, marker, important);
+ addProperty(CSSPropertyMarkerEnd, marker.release(), important);
+ return true;
+ }
default:
m_currentShorthand = oldShorthand;
return false;
« 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