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

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: hide behind RTEF 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..e9abe6cc5869c2cf78b5bf3a55d3ea04346d64da 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -967,6 +967,16 @@ static bool consumeGradientColorStops(CSSParserTokenRange& range,
if (!stop.m_color && !stop.m_offset)
return false;
gradient->addStop(stop);
+
+ if (!stop.m_color || !stop.m_offset ||
+ !RuntimeEnabledFeatures::multipleColorStopPositionsEnabled())
fs 2017/04/06 19:58:48 Ponder: Maybe we could have this as a: if (Runtim
f(malita) 2017/04/06 20:29:42 Done.
+ 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