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

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

Issue 1864523004: Add UMA metric for tracking root level listeners for blocking touch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 e3cfaf7cb01c70fbe6631718c17cf2e5526dab3c..2d55c9a9186e2a92cadd07f3b028a6449366d764 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -275,6 +275,7 @@ EventHandler::EventHandler(LocalFrame* frame)
, m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired)
, m_lastShowPressTimestamp(0)
, m_deltaConsumedForScrollSequence(false)
+ , m_waitingForFirstTouchMove(false)
{
}
@@ -3654,6 +3655,14 @@ public:
WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent& event,
HeapVector<TouchInfo>& touchInfos, bool freshTouchEvents, bool allTouchReleased)
{
+ bool firstTouchMoveAfterTouchStart = false;
+ if (event.type() == PlatformEvent::TouchStart) {
+ m_waitingForFirstTouchMove = true;
+ } else if (event.type() == PlatformEvent::TouchMove) {
+ firstTouchMoveAfterTouchStart = m_waitingForFirstTouchMove;
+ m_waitingForFirstTouchMove = false;
+ }
+
// Build up the lists to use for the 'touches', 'targetTouches' and
// 'changedTouches' attributes in the JS event. See
// http://www.w3.org/TR/touch-events/#touchevent-interface for how these
@@ -3738,7 +3747,7 @@ WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent&
RawPtr<TouchEvent> touchEvent = TouchEvent::create(
touches.get(), touchesByTarget.get(touchEventTarget), changedTouches[state].m_touches.get(),
eventName, touchEventTarget->toNode()->document().domWindow(),
- event.getModifiers(), event.cancelable(), event.causesScrollingIfUncanceled(), event.timestamp());
+ event.getModifiers(), event.cancelable(), event.causesScrollingIfUncanceled(), firstTouchMoveAfterTouchStart, event.timestamp());
eventResult = mergeEventResult(eventResult, toWebInputEventResult(touchEventTarget->dispatchEvent(touchEvent.get())));
}

Powered by Google App Engine
This is Rietveld 408576698