Index: third_party/WebKit/Source/core/input/EventHandler.cpp |
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp |
index 11ceff8b9b76b21dd8383d2dc9c321f1049c6cf5..1e59d1a2f147c397d241e6fca16c0b26de944ed6 100644 |
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
@@ -862,7 +862,7 @@ WebInputEventResult EventHandler::handleMousePressEvent(const PlatformMouseEvent |
} |
// m_selectionInitiationState is initialized after dispatching mousedown |
- // event in order not to keep the selection by DOM APIs Because we can't |
+ // event in order not to keep the selection by DOM APIs because we can't |
// give the user the chance to handle the selection by user action like |
// dragging if we keep the selection in case of mousedown. FireFox also has |
// the same behavior and it's more compatible with other browsers. |
@@ -1501,6 +1501,9 @@ WebInputEventResult EventHandler::updatePointerTargetAndDispatchEvents(const Ato |
Node* lastNodeUnderMouse = updateMouseEventTargetNode(targetNode, mouseEvent); |
+ if (mouseEvent.getSyntheticEventType() == PlatformMouseEvent::FromTouch) |
+ return dispatchMouseEvent(mouseEventType, m_nodeUnderMouse, clickCount, mouseEvent); |
+ |
return m_pointerEventManager.sendMousePointerEvent( |
m_nodeUnderMouse, mouseEventType, clickCount, mouseEvent, nullptr, |
lastNodeUnderMouse); |
@@ -2093,39 +2096,6 @@ WebInputEventResult EventHandler::sendContextMenuEventForKey(Element* overrideTa |
return sendContextMenuEvent(mouseEvent, overrideTargetElement); |
} |
-WebInputEventResult EventHandler::sendContextMenuEventForGesture(const GestureEventWithHitTestResults& targetedEvent) |
-{ |
- const PlatformGestureEvent& gestureEvent = targetedEvent.event(); |
- unsigned modifiers = gestureEvent.getModifiers(); |
- |
- // Send MouseMoved event prior to handling (https://crbug.com/485290). |
- PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.globalPosition(), |
- NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0, |
- static_cast<PlatformEvent::Modifiers>(modifiers), |
- PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerProperties::PointerType::Mouse); |
- dispatchMouseEvent(EventTypeNames::mousemove, targetedEvent.hitTestResult().innerNode(), 0, fakeMouseMove); |
- |
- PlatformEvent::EventType eventType = PlatformEvent::MousePressed; |
- |
- if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp()) |
- eventType = PlatformEvent::MouseReleased; |
- |
- // Always set right button down as we are sending mousedown event regardless |
- modifiers |= PlatformEvent::RightButtonDown; |
- |
- // TODO(crbug.com/579564): Maybe we should not send mouse down at all |
- PlatformMouseEvent mouseEvent(targetedEvent.event().position(), targetedEvent.event().globalPosition(), RightButton, eventType, 1, |
- static_cast<PlatformEvent::Modifiers>(modifiers), |
- PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), WebPointerProperties::PointerType::Mouse); |
- // To simulate right-click behavior, we send a right mouse down and then |
- // context menu event. |
- // FIXME: Send HitTestResults to avoid redundant hit tests. |
- handleMousePressEvent(mouseEvent); |
- return sendContextMenuEvent(mouseEvent); |
- // We do not need to send a corresponding mouse release because in case of |
- // right-click, the context menu takes capture and consumes all events. |
-} |
- |
void EventHandler::scheduleHoverStateUpdate() |
{ |
if (!m_hoverTimer.isActive()) |