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 933275c0f1bb0eb8ece6ccc861e0124b756fc810..c42d58574469c8e8921db970bc9babba6f76aa00 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; |
| + |
|
c.shu
2014/07/01 02:03:28
The above can be simplified as
Path specifiedPath
zino
2014/07/01 05:37:28
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."); |
|
Rik
2014/06/30 16:42:00
I know this isn't part of this CL but we really sh
zino
2014/07/01 05:37:28
I'm not sure but,
According to the spec, if the sp
|
| return; |
| } |
| - Path specifiedPath = m_path; |
| specifiedPath.transform(state().m_transform); |
| if (context->isClipMode()) { |