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

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

Issue 1989623002: Suppressed MEs for gestures from cancelled PEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed browser-side plumbing, added tests. Created 4 years, 7 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/PointerEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
index a4a0fa685e3d705a74c016139af1788c30837816..0a53c882f2ff435e5bb74e4fd82c91aa6868f9e6 100644
--- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -454,8 +454,6 @@ void PointerEventManager::dispatchTouchPointerEvents(
touchInfo.targetFrame = touchInfo.touchNode->document().frame();
}
- WebInputEventResult result = WebInputEventResult::NotHandled;
-
// Do not send pointer events for stationary touches or null targetFrame
if (touchInfo.touchNode
&& touchPoint.state() != PlatformTouchPoint::TouchStationary
@@ -474,15 +472,20 @@ void PointerEventManager::dispatchTouchPointerEvents(
touchInfo.touchNode ?
touchInfo.touchNode->document().domWindow() : nullptr);
- result = sendTouchPointerEvent(touchInfo.touchNode, pointerEvent);
- }
- // TODO(crbug.com/507408): Right now we add the touch point only if
- // its pointer event is NotHandled (e.g. preventDefault is called in
- // the pointer event listener). This behavior needs to change as it
- // may create some inconsistent touch event sequence.
- if (result == WebInputEventResult::NotHandled) {
- touchInfos.append(touchInfo);
+ WebInputEventResult result = sendTouchPointerEvent(touchInfo.touchNode, pointerEvent);
+
+ // Queue the WebInputEventResult to allow suppressing mouse events
+ // from gesture events. Since mouse events are fired only from
+ // GestureTap and GestureLongPress events which are triggered by
+ // single touches only, it is enough to queue the
Rick Byers 2016/05/27 20:39:27 Not quite true - GestureTwoFingerTap behaves simil
mustaq 2016/05/30 15:14:26 I will update the comment to clarify it: TwoFinger
mustaq 2016/06/02 19:26:27 Clarified the comment. My last post seems wrong ab
+ // WebInputEventResult for only primary pointerdowns.
+ if (pointerEvent->type() == EventTypeNames::pointerdown
+ && pointerEvent->isPrimary()) {
+ m_primaryPointerdownResults.append(result);
Rick Byers 2016/05/27 20:39:27 Unfortunately I don't think we can currently guara
dtapuska 2016/05/27 20:54:07 I'd prefer if the information went up the stack an
mustaq 2016/05/30 15:14:26 Local sync seems unavoidable. I had uniqueTouchIds
mustaq 2016/06/02 19:26:27 As we suspected, both of these cases can happen, s
+ }
}
+
+ touchInfos.append(touchInfo);
}
}
@@ -599,6 +602,7 @@ void PointerEventManager::clear()
m_touchEventManager.clear();
m_inCanceledStateForPointerTypeTouch = false;
m_pointerEventFactory.clear();
+ m_primaryPointerdownResults.clear();
m_nodeUnderPointer.clear();
m_pointerCaptureTarget.clear();
m_pendingPointerCaptureTarget.clear();

Powered by Google App Engine
This is Rietveld 408576698