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

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

Issue 2698083003: support function in custom paint input arguments (Closed)
Patch Set: fix Created 3 years, 10 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 ed502005d576616f98a37ef741888b1540a603e0..6ee0e1753a7cb01abd347b17b35bd4c0c6da23d4 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -1173,7 +1173,19 @@ static CSSValue* consumePaint(CSSParserTokenRange& args,
Vector<RefPtr<CSSVariableData>> variableData;
while (!args.atEnd()) {
if (args.peek().type() != CommaToken) {
- argumentTokens.push_back(args.consumeIncludingWhitespace());
+ if (args.peek().getBlockType() != CSSParserToken::BlockStart) {
meade_UTC10 2017/02/16 02:44:59 There's a lot of nested ifs in this while loop now
renjieliu1 2017/02/16 04:38:42 Done.
+ argumentTokens.push_back(args.consumeIncludingWhitespace());
+ } else {
+ // Encounter function block.
+ argumentTokens.push_back(args.peek());
meade_UTC10 2017/02/16 02:44:59 So this pushes an open brace, then the contents of
renjieliu1 2017/02/16 04:38:42 I totally agree that's what we should do, however,
+ CSSParserTokenRange contents = args.consumeBlock();
+ while (!contents.atEnd()) {
+ argumentTokens.push_back(contents.consume());
+ }
+ // Assume it is a function.
meade_UTC10 2017/02/16 02:44:59 This comment is confusing, suggest removing it.
renjieliu1 2017/02/16 04:38:42 Done.
+ argumentTokens.push_back(
+ CSSParserToken(RightParenthesisToken, CSSParserToken::BlockEnd));
+ }
} else {
if (!addCSSPaintArgument(argumentTokens, &variableData))
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698