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

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

Issue 2249663002: Fixed & refactored mouse event firing at gesture context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Realigned test outcomes. Created 4 years, 4 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 9c493509de23239b2fe56dfc1b07e9e7ef45db2b..31a0246d647096575b59b356fb9898a3478a1460 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -872,7 +872,7 @@ WebInputEventResult EventHandler::handleMousePressEvent(const PlatformMouseEvent
InputDeviceCapabilities* sourceCapabilities = mouseEvent.getSyntheticEventType() == PlatformMouseEvent::FromTouch ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() :
InputDeviceCapabilities::doesntFireTouchEventsSourceCapabilities();
if (eventResult == WebInputEventResult::NotHandled)
- eventResult = handleMouseFocus(MouseEventWithHitTestResults(mev.event(), hitTestResult), sourceCapabilities);
+ eventResult = handleMouseFocus(hitTestResult, sourceCapabilities);
m_capturesDragging = eventResult == WebInputEventResult::NotHandled || mev.scrollbar();
// If the hit testing originally determined the event was in a scrollbar, refetch the MouseEventWithHitTestResults
@@ -1518,9 +1518,6 @@ WebInputEventResult EventHandler::updatePointerTargetAndDispatchEvents(const Ato
Node* lastNodeUnderMouse = updateMouseEventTargetNode(targetNode, mouseEvent);
- if (mouseEvent.getSyntheticEventType() == PlatformMouseEvent::FromTouch)
bokan 2016/08/26 16:55:14 Help me understand, why was this removed?
mustaq 2016/08/26 17:19:03 This was added as a quick fix to prevent PE-firing
bokan 2016/08/26 17:31:53 So is this now ok because gesture events don't com
mustaq 2016/08/26 19:02:06 Right: from the overall event handling perspective
- return dispatchMouseEvent(mouseEventType, m_nodeUnderMouse, clickCount, mouseEvent);
-
Node* newNodeUnderMouse = nullptr;
const auto& eventResult = m_pointerEventManager.sendMousePointerEvent(
m_nodeUnderMouse, mouseEventType, clickCount, mouseEvent,
@@ -1534,11 +1531,11 @@ void EventHandler::setClickNode(Node* node)
m_clickNode = node;
}
-WebInputEventResult EventHandler::handleMouseFocus(const MouseEventWithHitTestResults& targetedEvent, InputDeviceCapabilities* sourceCapabilities)
+WebInputEventResult EventHandler::handleMouseFocus(const HitTestResult& hitTestResult, InputDeviceCapabilities* sourceCapabilities)
{
// If clicking on a frame scrollbar, do not mess up with content focus.
- if (targetedEvent.hitTestResult().scrollbar() && !m_frame->contentLayoutItem().isNull()) {
- if (targetedEvent.hitTestResult().scrollbar()->getScrollableArea() == m_frame->contentLayoutItem().getScrollableArea())
+ if (hitTestResult.scrollbar() && !m_frame->contentLayoutItem().isNull()) {
+ if (hitTestResult.scrollbar()->getScrollableArea() == m_frame->contentLayoutItem().getScrollableArea())
return WebInputEventResult::NotHandled;
}
@@ -1572,7 +1569,7 @@ WebInputEventResult EventHandler::handleMouseFocus(const MouseEventWithHitTestRe
// Only change the focus when clicking scrollbars if it can transfered to a
// mouse focusable node.
- if (!element && targetedEvent.hitTestResult().scrollbar())
+ if (!element && hitTestResult.scrollbar())
return WebInputEventResult::HandledSystem;
if (Page* page = m_frame->page()) {
@@ -2109,7 +2106,7 @@ WebInputEventResult EventHandler::sendContextMenuEventForKey(Element* overrideTa
eventType = PlatformEvent::MouseReleased;
PlatformMouseEvent mouseEvent(locationInRootFrame, globalPosition,
- WebPointerProperties::Button::Right, eventType, 1,
+ WebPointerProperties::Button::NoButton, eventType, /* clickCount */ 0,
PlatformEvent::NoModifiers, PlatformMouseEvent::RealOrIndistinguishable,
WTF::monotonicallyIncreasingTime(), WebPointerProperties::PointerType::Mouse);

Powered by Google App Engine
This is Rietveld 408576698