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

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

Issue 1441233006: Move remaining SVG properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 1a6cf290c7ff6ab745a5886f8603c906cc69012d..199b93e0eac4fd653eb392aef27882f9d4386f49 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1952,6 +1952,22 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeStrokeDasharray(CSSParserTokenRan
return dashes.release();
}
+static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeOpacity(CSSParserTokenRange& range)
Timothy Loh 2015/11/30 06:09:57 consumeSVGOpacity since opacity isn't going to cal
fs 2015/11/30 09:52:59 They really should be the same though (according t
rwlbuis 2015/11/30 22:17:43 The plot thickens. The only difference I saw was t
fs 2015/11/30 23:10:31 SGTM to remove if <other browser> passes the new t
+{
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> opacity = consumePercent(range, ValueRangeAll);
+ if (opacity)
+ return opacity;
Timothy Loh 2015/11/30 06:09:57 opacity.release();
rwlbuis 2015/11/30 22:17:43 Correct, however we may not need it.
+ return consumeNumber(range, ValueRangeAll);
+}
+
+static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeBaselineShift(CSSParserTokenRange& range)
+{
+ CSSValueID id = range.peek().id();
+ if (id == CSSValueBaseline || id == CSSValueSub || id == CSSValueSuper)
+ return consumeIdent(range);
+ return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll, UnitlessQuirk::Allow);
Timothy Loh 2015/11/30 06:09:57 Should be UnitlessQuirk::Forbid. SVGAttributeMode
rwlbuis 2015/11/30 22:17:43 Done.
+}
+
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty)
{
CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
@@ -2128,6 +2144,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
case CSSPropertyMarkerStart:
case CSSPropertyMarkerMid:
case CSSPropertyMarkerEnd:
+ case CSSPropertyClipPath:
+ case CSSPropertyFilter:
+ case CSSPropertyMask:
return consumeNoneOrURI(m_range);
case CSSPropertyFlexBasis:
return consumeFlexBasis(m_range, m_context.mode());
@@ -2138,6 +2157,25 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeStrokeDasharray(m_range);
case CSSPropertyWebkitColumnRuleWidth:
return consumeColumnRuleWidth(m_range, m_context.mode());
+ case CSSPropertyStrokeOpacity:
+ case CSSPropertyFillOpacity:
+ case CSSPropertyStopOpacity:
+ case CSSPropertyFloodOpacity:
+ return consumeOpacity(m_range);
+ case CSSPropertyBaselineShift:
+ return consumeBaselineShift(m_range);
+ case CSSPropertyStrokeMiterlimit:
+ return consumeNumber(m_range, ValueRangeNonNegative);
+ case CSSPropertyStrokeWidth:
+ case CSSPropertyStrokeDashoffset:
+ case CSSPropertyCx:
+ case CSSPropertyCy:
+ case CSSPropertyX:
+ case CSSPropertyY:
+ case CSSPropertyR:
+ case CSSPropertyRx:
+ case CSSPropertyRy:
+ return consumeLengthOrPercent(m_range, SVGAttributeMode, ValueRangeAll, UnitlessQuirk::Allow);
Timothy Loh 2015/11/30 06:09:57 ::Forbid
rwlbuis 2015/11/30 22:17:43 Done.
default:
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698