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

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

Issue 2799793002: Implement color stop position syntax from CSS Image Values 4 (Closed)
Patch Set: greedy color repeat serializer + more tests Created 3 years, 8 months 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/CSSPropertyParserHelpers.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
index 4f6e0cecc6c56aba31b4fc746fdb41599975ef8b..5156758a1c05bfb2377bb6b2df89427ed2d3e9a6 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -967,6 +967,17 @@ static bool consumeGradientColorStops(CSSParserTokenRange& range,
if (!stop.m_color && !stop.m_offset)
return false;
gradient->addStop(stop);
+
+ if (RuntimeEnabledFeatures::multipleColorStopPositionsEnabled()) {
+ if (!stop.m_color || !stop.m_offset)
+ continue;
+
+ // Optional second position.
+ stop.m_offset = consumePositionFunc(range, cssParserMode, ValueRangeAll,
+ UnitlessQuirk::Forbid);
+ if (stop.m_offset)
+ gradient->addStop(stop);
+ }
} while (consumeCommaIncludingWhitespace(range));
// The last color stop cannot be a color hint.

Powered by Google App Engine
This is Rietveld 408576698