| 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 5ec337e655cfa8a1cfe03b4df1cb535a050dfb01..c8f59fe2bde3f591f2da35f9b46490451f22933a 100644
|
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp
|
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
|
| @@ -158,25 +158,6 @@ const AtomicString& touchEventNameForTouchPointState(PlatformTouchPoint::State s
|
| }
|
| }
|
|
|
| -const AtomicString& pointerEventNameForTouchPointState(PlatformTouchPoint::State state)
|
| -{
|
| - switch (state) {
|
| - case PlatformTouchPoint::TouchReleased:
|
| - return EventTypeNames::pointerup;
|
| - case PlatformTouchPoint::TouchCancelled:
|
| - return EventTypeNames::pointercancel;
|
| - case PlatformTouchPoint::TouchPressed:
|
| - return EventTypeNames::pointerdown;
|
| - case PlatformTouchPoint::TouchMoved:
|
| - return EventTypeNames::pointermove;
|
| - case PlatformTouchPoint::TouchStationary:
|
| - // Fall through to default
|
| - default:
|
| - ASSERT_NOT_REACHED();
|
| - return emptyAtom;
|
| - }
|
| -}
|
| -
|
| const AtomicString& pointerEventNameForMouseEventName(const AtomicString& mouseEventName)
|
| {
|
| #define RETURN_CORRESPONDING_PE_NAME(eventSuffix) \
|
| @@ -364,6 +345,7 @@ DEFINE_TRACE(EventHandler)
|
| visitor->trace(m_previousGestureScrolledNode);
|
| visitor->trace(m_lastDeferredTapElement);
|
| visitor->trace(m_selectionController);
|
| + visitor->trace(m_pointerEventManager);
|
| #endif
|
| }
|
|
|
| @@ -3737,29 +3719,17 @@ void EventHandler::dispatchPointerEvents(const PlatformTouchEvent& event,
|
| for (unsigned i = 0; i < touchInfos.size(); ++i) {
|
| TouchInfo& touchInfo = touchInfos[i];
|
| const PlatformTouchPoint& touchPoint = touchInfo.point;
|
| - const PlatformTouchPoint::State pointState = touchPoint.state();
|
|
|
|
|
| - if (pointState == PlatformTouchPoint::TouchStationary || !touchInfo.knownTarget)
|
| + if (touchPoint.state() == PlatformTouchPoint::TouchStationary
|
| + || !touchInfo.knownTarget)
|
| continue;
|
|
|
| - bool pointerReleasedOrCancelled = pointState == PlatformTouchPoint::TouchReleased
|
| - || pointState == PlatformTouchPoint::TouchCancelled;
|
| -
|
| - RefPtrWillBeRawPtr<PointerEvent> pointerEvent = m_pointerEventManager.create(
|
| - pointerEventNameForTouchPointState(pointState),
|
| + touchInfo.consumed = m_pointerEventManager.sendTouchPointerEvent(
|
| + touchInfo.touchTarget,
|
| touchPoint, event.modifiers(),
|
| touchInfo.adjustedRadius.width(), touchInfo.adjustedRadius.height(),
|
| touchInfo.adjustedPagePoint.x(), touchInfo.adjustedPagePoint.y());
|
| -
|
| - // TODO(nzolghadr): crbug.com/579553 dealing with implicit touch capturing vs pointer event capturing
|
| - touchInfo.touchTarget->dispatchEvent(pointerEvent.get());
|
| -
|
| - touchInfo.consumed = pointerEvent->defaultPrevented() || pointerEvent->defaultHandled();
|
| -
|
| - // Remove the released/cancelled id at the end to correctly determine primary id above.
|
| - if (pointerReleasedOrCancelled)
|
| - m_pointerEventManager.remove(pointerEvent);
|
| }
|
| }
|
|
|
| @@ -3777,12 +3747,9 @@ void EventHandler::sendPointerCancels(WillBeHeapVector<TouchInfo>& touchInfos)
|
| || pointState == PlatformTouchPoint::TouchCancelled)
|
| continue;
|
|
|
| - RefPtrWillBeRawPtr<PointerEvent> pointerEvent = m_pointerEventManager.createPointerCancel(point);
|
| -
|
| - // TODO(nzolghadr): crbug.com/579553 dealing with implicit touch capturing vs pointer event capturing
|
| - touchInfo.touchTarget->dispatchEvent(pointerEvent.get());
|
| -
|
| - m_pointerEventManager.remove(pointerEvent);
|
| + m_pointerEventManager.sendTouchCancelPointerEvent(
|
| + touchInfo.touchTarget,
|
| + point);
|
| }
|
| }
|
|
|
|
|