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

Unified Diff: experimental/svg/model/SkSVGAttributeParser.cpp

Issue 2225623002: [SVGDom] Improve whitespace handling in style parsing (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | experimental/svg/model/SkSVGDOM.cpp » ('j') | experimental/svg/model/SkSVGDOM.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | experimental/svg/model/SkSVGDOM.cpp » ('j') | experimental/svg/model/SkSVGDOM.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698