Index: third_party/WebKit/Source/core/dom/Document.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
index 758cfb9ed5c23e015338da211994c7ad1189cdfa..f8d81f74113d91ab2d04a58971a36c4c6f6bf22a 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -181,6 +181,7 @@ |
#include "core/inspector/InspectorTraceEvents.h" |
#include "core/inspector/InstanceCounters.h" |
#include "core/inspector/MainThreadDebugger.h" |
+#include "core/layout/HitTestCanvasResult.h" |
#include "core/layout/HitTestResult.h" |
#include "core/layout/LayoutPart.h" |
#include "core/layout/LayoutView.h" |
@@ -3182,10 +3183,11 @@ MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r |
if (isHTMLCanvasElement(result.innerNode())) { |
PlatformMouseEvent eventWithRegion = event; |
- std::pair<Element*, String> regionInfo = toHTMLCanvasElement(result.innerNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame()); |
- if (regionInfo.first) |
- result.setInnerNode(regionInfo.first); |
- eventWithRegion.setRegion(regionInfo.second); |
+ HitTestCanvasResult* hitTestCanvasResult = toHTMLCanvasElement(result.innerNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame()); |
+ if (hitTestCanvasResult->getControl()) { |
+ result.setInnerNode(hitTestCanvasResult->getControl()); |
+ } |
+ eventWithRegion.setRegion(hitTestCanvasResult->getId()); |
return MouseEventWithHitTestResults(eventWithRegion, result); |
} |