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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2141993003: PointerEvents for long-press: fix double firing & canceling MEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed preventing MEs on canceled pointerdowns Created 4 years, 5 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/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 aaa15c7641c5b62fc981bb806c25428ee34e8e30..069841fce879ef4827fae4017e458b147cdad2b2 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -863,7 +863,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.
@@ -2094,39 +2094,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())

Powered by Google App Engine
This is Rietveld 408576698