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

Side by Side Diff: third_party/WebKit/Source/core/input/TouchEventManager.cpp

Issue 1989623002: Suppressed MEs for gestures from cancelled PEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a comment. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/input/TouchEventManager.h" 5 #include "core/input/TouchEventManager.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/events/TouchEvent.h" 8 #include "core/events/TouchEvent.h"
9 #include "core/frame/EventHandlerRegistry.h" 9 #include "core/frame/EventHandlerRegistry.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 return true; 411 return true;
412 } 412 }
413 413
414 WebInputEventResult TouchEventManager::handleTouchEvent( 414 WebInputEventResult TouchEventManager::handleTouchEvent(
415 const PlatformTouchEvent& event, 415 const PlatformTouchEvent& event,
416 HeapVector<TouchInfo>& touchInfos) 416 HeapVector<TouchInfo>& touchInfos)
417 { 417 {
418 if (!reHitTestTouchPointsIfNeeded(event, touchInfos)) 418 if (!reHitTestTouchPointsIfNeeded(event, touchInfos))
419 return WebInputEventResult::NotHandled; 419 return WebInputEventResult::NotHandled;
420 420
421 // Note that the disposition of any pointer events affects only the generati on of touch
422 // events. If all pointer events were handled (and hence no touch events wer e fired), that
423 // is still equivalent to the touch events going unhandled because pointer e vent handler
424 // don't block scroll gesture generation.
425
426 // TODO(crbug.com/507408): If PE handlers always call preventDefault, we won 't see TEs until after
427 // scrolling starts because the scrolling would suppress upcoming PEs. This sudden "break" in TE
428 // suppression can make the visible TEs inconsistent (e.g. touchmove without a touchstart).
429
430 bool allTouchesReleased = true; 421 bool allTouchesReleased = true;
431 for (const auto& point : event.touchPoints()) { 422 for (const auto& point : event.touchPoints()) {
432 if (point.state() != PlatformTouchPoint::TouchReleased 423 if (point.state() != PlatformTouchPoint::TouchReleased
433 && point.state() != PlatformTouchPoint::TouchCancelled) 424 && point.state() != PlatformTouchPoint::TouchCancelled)
434 allTouchesReleased = false; 425 allTouchesReleased = false;
435 } 426 }
436 427
437 // Whether a touch should be considered a "user gesture" or not is a tricky question. 428 // Whether a touch should be considered a "user gesture" or not is a tricky question.
438 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZ u7nvOg/edit# 429 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZ u7nvOg/edit#
439 430
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 } 478 }
488 479
489 DEFINE_TRACE(TouchEventManager) 480 DEFINE_TRACE(TouchEventManager)
490 { 481 {
491 visitor->trace(m_frame); 482 visitor->trace(m_frame);
492 visitor->trace(m_touchSequenceDocument); 483 visitor->trace(m_touchSequenceDocument);
493 visitor->trace(m_targetForTouchID); 484 visitor->trace(m_targetForTouchID);
494 } 485 }
495 486
496 } // namespace blink 487 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698