Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(800)

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 1630683002: Canvas2d: addHitRegion() should take clipping region into account. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698