Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp |
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp |
index a7155d9eea21952d09be79e81fd6ccc9a465ae25..a16a6576496514d0b6c3a5dd869740d6efeff246 100644 |
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp |
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp |
@@ -2218,11 +2218,9 @@ void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc |
hitRegionPath.transform(state().transform()); |
if (state().hasClip()) { |
- // FIXME: The hit regions should take clipping region into account. |
- // However, we have no way to get the region from canvas state stack by now. |
- // See http://crbug.com/387057 |
- exceptionState.throwDOMException(NotSupportedError, "The specified path has no pixels."); |
- return; |
+ hitRegionPath = state().intersectPathWithClip(hitRegionPath.skPath()); |
+ if (hitRegionPath.isEmpty()) |
+ exceptionState.throwDOMException(NotSupportedError, "The specified path has no pixels."); |
} |
if (!m_hitRegionManager) |