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 80701533c53fb47b240635b5e57d614c198f6831..3f4b9c39135da24e7d5ded367bbf7cce9961e8b0 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -3218,6 +3218,15 @@ MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r |
if (!request.readOnly()) |
updateHoverActiveState(request, result.innerElement()); |
+ 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); |
+ return MouseEventWithHitTestResults(eventWithRegion, result); |
+ } |
+ |
return MouseEventWithHitTestResults(event, result); |
} |
@@ -5436,7 +5445,7 @@ PassRefPtrWillBeRawPtr<Touch> Document::createTouch(DOMWindow* window, EventTarg |
// when this method should throw and nor is it by inspection of iOS behavior. It would be nice to verify any cases where it throws under iOS |
// and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=47819 |
LocalFrame* frame = window && window->isLocalDOMWindow() ? toLocalDOMWindow(window)->frame() : this->frame(); |
- return Touch::create(frame, target, identifier, FloatPoint(screenX, screenY), FloatPoint(pageX, pageY), FloatSize(radiusX, radiusY), rotationAngle, force); |
+ return Touch::create(frame, target, identifier, FloatPoint(screenX, screenY), FloatPoint(pageX, pageY), FloatSize(radiusX, radiusY), rotationAngle, force, String()); |
} |
PassRefPtrWillBeRawPtr<TouchList> Document::createTouchList(WillBeHeapVector<RefPtrWillBeMember<Touch>>& touches) const |