| 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 8d161e1ef2727d4b4eb29e42defb9eefbf560174..165b255623a1b97501e1d09320796dbd6511b5c0 100644
|
| --- a/third_party/WebKit/Source/core/input/TouchEventManager.cpp
|
| +++ b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
|
| @@ -62,6 +62,18 @@ enum TouchEventDispatchResultType {
|
| TouchEventDispatchResultTypeMax,
|
| };
|
|
|
| +bool IsTouchSequenceStart(const PlatformTouchEvent& event) {
|
| + if (!event.touchPoints().size())
|
| + return false;
|
| + if (event.type() != PlatformEvent::TouchStart)
|
| + return false;
|
| + for (const auto& point : event.touchPoints()) {
|
| + if (point.state() != PlatformTouchPoint::TouchPressed)
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| // Defining this class type local to dispatchTouchEvents() and annotating
|
| // it with STACK_ALLOCATED(), runs into MSVC(VS 2013)'s C4822 warning
|
| // that the local class doesn't provide a local definition for 'operator new'.
|
| @@ -96,6 +108,7 @@ void TouchEventManager::clear() {
|
| m_regionForTouchID.clear();
|
| m_touchPressed = false;
|
| m_currentEvent = PlatformEvent::NoType;
|
| + m_suppressingTouchmovesWithinSlop = false;
|
| m_currentTouchAction = TouchActionAuto;
|
| }
|
|
|
| @@ -114,6 +127,23 @@ 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 (IsTouchSequenceStart(event))
|
| + m_suppressingTouchmovesWithinSlop = true;
|
| +
|
| + if (event.type() == PlatformEvent::TouchEnd ||
|
| + event.type() == PlatformEvent::TouchCancel ||
|
| + event.touchPoints().size() > 1) {
|
| + m_suppressingTouchmovesWithinSlop = false;
|
| + }
|
| +
|
| + if (m_suppressingTouchmovesWithinSlop &&
|
| + event.type() == PlatformEvent::TouchMove) {
|
| + if (!event.causesScrollingIfUncanceled())
|
| + return WebInputEventResult::HandledSuppressed;
|
| + m_suppressingTouchmovesWithinSlop = false;
|
| + }
|
| +
|
| // Holds the complete set of touches on the screen.
|
| TouchList* touches = TouchList::create();
|
|
|
|
|