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

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

Issue 2669663002: Move touch slop suppression to TouchEventManager (Closed)
Patch Set: slop region Created 3 years, 11 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/TouchEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/TouchEventManager.cpp b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
index 6561639c92306c184a507ffda0ca0ebbd7347306..3b2945b5359b014b1898605c267490a5527910a5 100644
--- a/third_party/WebKit/Source/core/input/TouchEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
@@ -95,6 +95,7 @@ void TouchEventManager::clear() {
m_targetForTouchID.clear();
m_regionForTouchID.clear();
m_touchPressed = false;
+ m_suppressingTouchmoves = false;
m_currentTouchAction = TouchActionAuto;
}
@@ -113,6 +114,17 @@ WebInputEventResult TouchEventManager::dispatchTouchEvents(
// http://www.w3.org/TR/touch-events/#touchevent-interface for how these
// lists fit together.
+ // Suppress all the touch moves in the slop region.
+ if (event.type() == WebInputEvent::TouchStart)
dtapuska 2017/02/01 15:42:06 I don't think this matches the consistent state we
lanwei 2017/02/02 19:49:36 Done.
+ m_suppressingTouchmoves = true;
+
+ if (m_suppressingTouchmoves && event.type() == WebInputEvent::TouchMove &&
+ touchInfos.size() == 1) {
+ if (!event.movedBeyondSlopRegion)
+ return WebInputEventResult::HandledSuppressed;
+ m_suppressingTouchmoves = false;
+ }
+
// Holds the complete set of touches on the screen.
TouchList* touches = TouchList::create();

Powered by Google App Engine
This is Rietveld 408576698