Chromium Code Reviews| Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| index f06b7c6a5c8343a301221eb517d696ba5e7d3e84..a34a5332a8c1b1092859479e47387d46e7d98de7 100644 |
| --- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| +++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| @@ -2373,16 +2373,19 @@ void CanvasRenderingContext2D::addHitRegion(const Dictionary& options, Exception |
| return; |
| } |
| + RefPtr<Path2D> path2d; |
| + options.getWithUndefinedOrNullCheck("path", path2d); |
| + Path specifiedPath = path2d ? path2d->path() : m_path; |
|
Justin Novosad
2014/07/04 15:02:44
specififiedPath is not necessarily a "specified pa
zino
2014/07/05 03:01:22
Done.
|
| + |
| FloatRect clipBounds; |
| GraphicsContext* context = drawingContext(); |
| - if (m_path.isEmpty() || !context || !state().m_invertibleCTM |
| + if (specifiedPath.isEmpty() || !context || !state().m_invertibleCTM |
| || !context->getTransformedClipBounds(&clipBounds)) { |
| exceptionState.throwDOMException(NotSupportedError, "The specified path has no pixels."); |
| return; |
| } |
| - Path specifiedPath = m_path; |
| specifiedPath.transform(state().m_transform); |
| if (context->isClipMode()) { |