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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp

Issue 2560993003: Fix the parsing of colors used as canvas styles to ignore whitespace (Closed)
Patch Set: Created 4 years 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 | « third_party/WebKit/LayoutTests/fast/canvas/canvas-whitespace-parsing.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp
index 3f8b1894d780b0030bf109ad595049b96cfd51e0..0c24f22e2d24c6af24c54113375796c37b746e75 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp
@@ -32,6 +32,7 @@
#include "core/css/StylePropertySet.h"
#include "core/css/parser/CSSParser.h"
#include "core/html/HTMLCanvasElement.h"
+#include "core/html/parser/HTMLParserIdioms.h"
#include "modules/canvas2d/CanvasGradient.h"
#include "modules/canvas2d/CanvasPattern.h"
#include "platform/graphics/skia/SkiaUtils.h"
@@ -71,7 +72,8 @@ static Color currentColor(HTMLCanvasElement* canvas) {
bool parseColorOrCurrentColor(Color& parsedColor,
const String& colorString,
HTMLCanvasElement* canvas) {
- ColorParseResult parseResult = parseColor(parsedColor, colorString);
+ ColorParseResult parseResult =
+ parseColor(parsedColor, colorString.stripWhiteSpace(isHTMLSpace<UChar>));
switch (parseResult) {
case ParsedRGBA:
case ParsedSystemColor:
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/canvas-whitespace-parsing.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698