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

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

Issue 2701553002: Touchmoves should not be suppressed if the touchstart is consumed (Closed)
Patch Set: slop region Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-in-slop-region.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/Deprecation.h" 9 #include "core/frame/Deprecation.h"
10 #include "core/frame/EventHandlerRegistry.h" 10 #include "core/frame/EventHandlerRegistry.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 ? HandledTouches 285 ? HandledTouches
286 : UnhandledTouches); 286 : UnhandledTouches);
287 } 287 }
288 } 288 }
289 eventResult = EventHandlingUtil::mergeEventResult( 289 eventResult = EventHandlingUtil::mergeEventResult(
290 eventResult, 290 eventResult,
291 EventHandlingUtil::toWebInputEventResult(domDispatchResult)); 291 EventHandlingUtil::toWebInputEventResult(domDispatchResult));
292 } 292 }
293 } 293 }
294 294
295 // Do not suppress any touchmoves if the touchstart is consumed.
Rick Byers 2017/02/16 21:21:57 nit: it seems like it would be a small clean-up to
mustaq 2017/02/16 21:41:26 The "true" value is used in Line 138, so we have t
Rick Byers 2017/02/16 22:09:19 But it's used only if we're currently processing a
lanwei 2017/02/17 15:11:17 Acknowledged. Yes, we can merge line 131 here, tha
296 if (m_suppressingTouchmovesWithinSlop &&
297 event.type() == WebInputEvent::TouchStart &&
298 eventResult != WebInputEventResult::NotHandled) {
299 m_suppressingTouchmovesWithinSlop = false;
300 }
301
295 return eventResult; 302 return eventResult;
296 } 303 }
297 304
298 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts( 305 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts(
299 HeapVector<TouchInfo>& touchInfos) { 306 HeapVector<TouchInfo>& touchInfos) {
300 for (auto& touchInfo : touchInfos) { 307 for (auto& touchInfo : touchInfos) {
301 // Touch events implicitly capture to the touched node, and don't change 308 // Touch events implicitly capture to the touched node, and don't change
302 // active/hover states themselves (Gesture events do). So we only need 309 // active/hover states themselves (Gesture events do). So we only need
303 // to hit-test on touchstart and when the target could be different than 310 // to hit-test on touchstart and when the target could be different than
304 // the corresponding pointer event target. 311 // the corresponding pointer event target.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } 519 }
513 520
514 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); 521 return dispatchTouchEvents(event, touchInfos, allTouchesReleased);
515 } 522 }
516 523
517 bool TouchEventManager::isAnyTouchActive() const { 524 bool TouchEventManager::isAnyTouchActive() const {
518 return m_touchPressed; 525 return m_touchPressed;
519 } 526 }
520 527
521 } // namespace blink 528 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-in-slop-region.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698