OLD | NEW |
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/Deprecation.h" | 9 #include "core/frame/Deprecation.h" |
10 #include "core/frame/EventHandlerRegistry.h" | 10 #include "core/frame/EventHandlerRegistry.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 WebInputEventResult TouchEventManager::handleTouchEvent( | 437 WebInputEventResult TouchEventManager::handleTouchEvent( |
438 const PlatformTouchEvent& event, | 438 const PlatformTouchEvent& event, |
439 HeapVector<TouchInfo>& touchInfos) | 439 HeapVector<TouchInfo>& touchInfos) |
440 { | 440 { |
441 // Track the current event for the scope of this function. | 441 // Track the current event for the scope of this function. |
442 CurrentEventHolder holder(m_currentEvent, event.type()); | 442 CurrentEventHolder holder(m_currentEvent, event.type()); |
443 | 443 |
444 if (!reHitTestTouchPointsIfNeeded(event, touchInfos)) | 444 if (!reHitTestTouchPointsIfNeeded(event, touchInfos)) |
445 return WebInputEventResult::NotHandled; | 445 return WebInputEventResult::NotHandled; |
446 | 446 |
447 // Note that the disposition of any pointer events affects only the generati
on of touch | |
448 // events. If all pointer events were handled (and hence no touch events wer
e fired), that | |
449 // is still equivalent to the touch events going unhandled because pointer e
vent handler | |
450 // don't block scroll gesture generation. | |
451 | |
452 // TODO(crbug.com/507408): If PE handlers always call preventDefault, we won
't see TEs until after | |
453 // scrolling starts because the scrolling would suppress upcoming PEs. This
sudden "break" in TE | |
454 // suppression can make the visible TEs inconsistent (e.g. touchmove without
a touchstart). | |
455 | |
456 bool allTouchesReleased = true; | 447 bool allTouchesReleased = true; |
457 for (const auto& point : event.touchPoints()) { | 448 for (const auto& point : event.touchPoints()) { |
458 if (point.state() != PlatformTouchPoint::TouchReleased | 449 if (point.state() != PlatformTouchPoint::TouchReleased |
459 && point.state() != PlatformTouchPoint::TouchCancelled) | 450 && point.state() != PlatformTouchPoint::TouchCancelled) |
460 allTouchesReleased = false; | 451 allTouchesReleased = false; |
461 } | 452 } |
462 | 453 |
463 // Whether a touch should be considered a "user gesture" or not is a tricky
question. | 454 // Whether a touch should be considered a "user gesture" or not is a tricky
question. |
464 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZ
u7nvOg/edit# | 455 // https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZ
u7nvOg/edit# |
465 | 456 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 feature = UseCounter::TouchEndDuringScrollUserGestureUtilized; | 531 feature = UseCounter::TouchEndDuringScrollUserGestureUtilized; |
541 break; | 532 break; |
542 default: | 533 default: |
543 NOTREACHED(); | 534 NOTREACHED(); |
544 return; | 535 return; |
545 } | 536 } |
546 Deprecation::countDeprecation(m_frame, feature); | 537 Deprecation::countDeprecation(m_frame, feature); |
547 } | 538 } |
548 | 539 |
549 } // namespace blink | 540 } // namespace blink |
OLD | NEW |