Chromium Code Reviews| 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 d7f716a57c61e533a4dc748e27aba1a225947de6..709844c16fc21d3474e1ddae4343765184e6ed6a 100644 |
| --- a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp |
| +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp |
| @@ -79,6 +79,22 @@ bool parseColorOrCurrentColor(Color& parsedColor, const String& colorString, HTM |
| } |
| } |
| +bool parseColorOnly(Color& parsedColor, const String& colorString) |
|
Justin Novosad
2016/03/17 18:46:10
You could have continued to used the old parseColo
ikilpatrick
2016/03/17 19:15:41
Ah. That's great. Thanks. Done.
|
| +{ |
| + ColorParseResult parseResult = parseColor(parsedColor, colorString); |
| + switch (parseResult) { |
| + case ParsedRGBA: |
| + case ParsedSystemColor: |
| + return true; |
| + case ParsedCurrentColor: |
| + case ParseFailed: |
| + return false; |
| + default: |
| + ASSERT_NOT_REACHED(); |
| + return false; |
| + } |
| +} |
| + |
| CanvasStyle::CanvasStyle(RGBA32 rgba) |
| : m_type(ColorRGBA) |
| , m_rgba(rgba) |