Index: experimental/svg/model/SkSVGAttributeParser.cpp |
diff --git a/experimental/svg/model/SkSVGAttributeParser.cpp b/experimental/svg/model/SkSVGAttributeParser.cpp |
index f973d385f5751906a40374c3b396ea4d3e97b2e2..7a2561cdf718f5b8c91cc52c219fc8d4b2a233fd 100644 |
--- a/experimental/svg/model/SkSVGAttributeParser.cpp |
+++ b/experimental/svg/model/SkSVGAttributeParser.cpp |
@@ -152,13 +152,20 @@ bool SkSVGAttributeParser::parseHexColorToken(SkColor* c) { |
bool SkSVGAttributeParser::parseColor(SkSVGColorType* color) { |
SkColor c; |
+ // consume preceding whitespace |
+ this->parseWSToken(); |
+ |
// TODO: rgb(...) |
+ bool parsedValue = false; |
if (this->parseHexColorToken(&c) || this->parseNamedColorToken(&c)) { |
*color = SkSVGColorType(c); |
- return true; |
+ parsedValue = true; |
+ |
+ // consume trailing whitespace |
+ this->parseWSToken(); |
} |
- return false; |
+ return parsedValue && this->parseEOSToken(); |
} |
// https://www.w3.org/TR/SVG/types.html#DataTypeNumber |