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

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

Issue 1800143002: Notify Blink about start of gesture scroll through a queued event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed touch_event_stream_validator Created 4 years, 9 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/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index faa7a4369530259eafb0876798511dcbeacb75cf..69ab4aaf310a4cfcdd2f5fe274b9b0b84a6aec6d 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -259,7 +259,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)
@@ -336,7 +335,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;
@@ -3590,26 +3588,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
@@ -3733,6 +3711,11 @@ WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve
{
TRACE_EVENT0("blink", "EventHandler::handleTouchEvent");
+ if (event.type() == PlatformEvent::TouchScrollStarted) {
+ m_pointerEventManager.blockTouchPointers();
+ return WebInputEventResult::HandledSystem;
+ }
+
const Vector<PlatformTouchPoint>& points = event.touchPoints();
bool freshTouchEvents = true;
tdresser 2016/04/01 14:50:24 I'm not a big fan of the name of this variable. Co
mustaq 2016/04/01 18:31:05 Done.
@@ -3909,33 +3892,19 @@ WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve
touchInfo.region = regionID;
}
- 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)

Powered by Google App Engine
This is Rietveld 408576698