Chromium Code Reviews| Index: experimental/svg/model/SkSVGAttributeParser.cpp |
| diff --git a/experimental/svg/model/SkSVGAttributeParser.cpp b/experimental/svg/model/SkSVGAttributeParser.cpp |
| index 75e5d12f38558868bc2b15dfa426b15c84d1740f..5e20a266d02a98051de282188867079598dd4c11 100644 |
| --- a/experimental/svg/model/SkSVGAttributeParser.cpp |
| +++ b/experimental/svg/model/SkSVGAttributeParser.cpp |
| @@ -152,13 +152,18 @@ bool SkSVGAttributeParser::parseHexColorToken(SkColor* c) { |
| bool SkSVGAttributeParser::parseColor(SkSVGColor* color) { |
| SkColor c; |
| + // consume preceding whitespace |
| + this->parseWSToken(); |
| + |
| // TODO: rgb(...) |
| if (this->parseHexColorToken(&c) || this->parseNamedColorToken(&c)) { |
| *color = SkSVGColor(c); |
| - return true; |
| + |
| + // consume trailing whitespace |
| + this->parseWSToken(); |
| } |
|
robertphillips
2016/08/08 12:39:30
Do we need to init 'color' to something in case th
f(malita)
2016/08/08 13:00:02
All SVG types have default constructors, so color
|
| - return false; |
| + return this->parseEOSToken(); |
| } |
| // https://www.w3.org/TR/SVG/types.html#DataTypeNumber |