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 106c93fae5d436049d583a4aae50282c7165b75e..b91681c998d2fa85dd0f37079a14caf2af10ab1f 100644 |
| --- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| +++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| @@ -2373,16 +2373,24 @@ void CanvasRenderingContext2D::addHitRegion(const Dictionary& options, Exception |
| return; |
| } |
| + RefPtr<Path2D> path2d; |
| + options.getWithUndefinedOrNullCheck("path", path2d); |
| + |
| + Path specifiedPath; |
| + if (path2d) |
| + specifiedPath = path2d->path(); |
| + else |
| + specifiedPath = m_path; |
|
Rik
2014/06/29 03:22:22
Will the current CTM be applied to the path that y
zino
2014/06/29 04:07:18
Yes, you can see here.
2394 specifiedPath.tran
|
| + |
| 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()) { |