| 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 6dd54001587b8793c2427a3817dc2ad4c4f751d5..c5e9d3420af308dac6cf78ebbb7a02239596fb51 100644
|
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp
|
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
|
| @@ -258,7 +258,6 @@ EventHandler::EventHandler(LocalFrame* frame)
|
| , m_mousePositionIsUnknown(true)
|
| , m_mouseDownTimestamp(0)
|
| , m_touchPressed(false)
|
| - , m_inPointerCanceledState(false)
|
| , m_scrollGestureHandlingNode(nullptr)
|
| , m_lastGestureScrollOverWidget(false)
|
| , m_longTapShouldInvokeContextMenu(false)
|
| @@ -334,7 +333,6 @@ void EventHandler::clear()
|
| m_scrollbarHandlingScrollGesture = nullptr;
|
| m_touchPressed = false;
|
| m_pointerEventManager.clear();
|
| - m_inPointerCanceledState = false;
|
| m_mouseDownMayStartDrag = false;
|
| m_lastShowPressTimestamp = 0;
|
| m_lastDeferredTapElement = nullptr;
|
| @@ -3629,26 +3627,6 @@ void EventHandler::dispatchPointerEvents(const PlatformTouchEvent& event,
|
| }
|
| }
|
|
|
| -void EventHandler::sendPointerCancels(WillBeHeapVector<TouchInfo>& touchInfos)
|
| -{
|
| - if (!RuntimeEnabledFeatures::pointerEventEnabled())
|
| - return;
|
| -
|
| - for (unsigned i = 0; i < touchInfos.size(); ++i) {
|
| - TouchInfo& touchInfo = touchInfos[i];
|
| - const PlatformTouchPoint& point = touchInfo.point;
|
| - const PlatformTouchPoint::TouchState pointState = point.state();
|
| -
|
| - if (pointState == PlatformTouchPoint::TouchReleased
|
| - || pointState == PlatformTouchPoint::TouchCancelled)
|
| - continue;
|
| -
|
| - m_pointerEventManager.sendTouchCancelPointerEvent(
|
| - touchInfo.touchTarget,
|
| - point);
|
| - }
|
| -}
|
| -
|
| namespace {
|
|
|
| // Defining this class type local to dispatchTouchEvents() and annotating
|
| @@ -3771,6 +3749,13 @@ WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve
|
| {
|
| TRACE_EVENT0("blink", "EventHandler::handleTouchEvent");
|
|
|
| + fprintf(stderr, "======= mDebug %s received %d\n", __FUNCTION__, event.type() - PlatformEvent::TouchStart);
|
| +
|
| + if (event.type() == PlatformEvent::TouchScrollStarted) {
|
| + m_pointerEventManager.blockTouchPointers();
|
| + return WebInputEventResult::HandledSystem;
|
| + }
|
| +
|
| const Vector<PlatformTouchPoint>& points = event.touchPoints();
|
|
|
| bool freshTouchEvents = true;
|
| @@ -3936,33 +3921,19 @@ WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve
|
| touchInfo.consumed = false;
|
| }
|
|
|
| - if (!m_inPointerCanceledState) {
|
| - dispatchPointerEvents(event, touchInfos);
|
| - // Note that the disposition of any pointer events affects only the generation of touch
|
| - // events. If all pointer events were handled (and hence no touch events were fired), that
|
| - // is still equivalent to the touch events going unhandled because pointer event handler
|
| - // don't block scroll gesture generation.
|
| - }
|
| + if (freshTouchEvents)
|
| + m_pointerEventManager.unblockTouchPointers();
|
| + dispatchPointerEvents(event, touchInfos);
|
| + // Note that the disposition of any pointer events affects only the generation of touch
|
| + // events. If all pointer events were handled (and hence no touch events were fired), that
|
| + // is still equivalent to the touch events going unhandled because pointer event handler
|
| + // don't block scroll gesture generation.
|
|
|
| // TODO(crbug.com/507408): If PE handlers always call preventDefault, we won't see TEs until after
|
| // scrolling starts because the scrolling would suppress upcoming PEs. This sudden "break" in TE
|
| // suppression can make the visible TEs inconsistent (e.g. touchmove without a touchstart).
|
|
|
| - WebInputEventResult eventResult = dispatchTouchEvents(event, touchInfos, freshTouchEvents,
|
| - allTouchReleased);
|
| -
|
| - if (!m_inPointerCanceledState) {
|
| - // Check if we need to stop firing pointer events because of a touch action.
|
| - // See: www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-behaviors
|
| - if (event.causesScrollingIfUncanceled() && eventResult == WebInputEventResult::NotHandled) {
|
| - m_inPointerCanceledState = true;
|
| - sendPointerCancels(touchInfos);
|
| - }
|
| - } else if (allTouchReleased) {
|
| - m_inPointerCanceledState = false;
|
| - }
|
| -
|
| - return eventResult;
|
| + return dispatchTouchEvents(event, touchInfos, freshTouchEvents, allTouchReleased);
|
| }
|
|
|
| void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event)
|
|
|