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

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

Issue 2755753003: Ignore pointer capture target while calculating click target (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/input/MouseEventManager.cpp ('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/PointerEventManager.h" 5 #include "core/input/PointerEventManager.h"
6 6
7 #include "core/dom/DocumentUserGestureToken.h" 7 #include "core/dom/DocumentUserGestureToken.h"
8 #include "core/dom/ElementTraversal.h" 8 #include "core/dom/ElementTraversal.h"
9 #include "core/dom/shadow/FlatTreeTraversal.h" 9 #include "core/dom/shadow/FlatTreeTraversal.h"
10 #include "core/events/MouseEvent.h" 10 #include "core/events/MouseEvent.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 if (isInDocument(context.node())) { 495 if (isInDocument(context.node())) {
496 mouseTarget = context.node(); 496 mouseTarget = context.node();
497 break; 497 break;
498 } 498 }
499 } 499 }
500 } 500 }
501 result = EventHandlingUtil::mergeEventResult( 501 result = EventHandlingUtil::mergeEventResult(
502 result, 502 result,
503 m_mouseEventManager->dispatchMouseEvent( 503 m_mouseEventManager->dispatchMouseEvent(
504 mouseTarget, mouseEventType, mouseEvent, canvasRegionId, nullptr)); 504 mouseTarget, mouseEventType, mouseEvent, canvasRegionId, nullptr));
505 }
505 506
506 if (selectionOverLink && mouseTarget && 507 if (selectionOverLink && mouseEventType == EventTypeNames::mouseup) {
507 mouseEventType == EventTypeNames::mouseup) { 508 WebInputEventResult clickEventResult =
508 WebInputEventResult clickEventResult = 509 m_mouseEventManager->dispatchMouseClickIfNeeded(
509 m_mouseEventManager->dispatchMouseClickIfNeeded( 510 pointerEventTarget ? pointerEventTarget->toNode() : nullptr,
510 mouseTarget->toNode(), mouseEvent, canvasRegionId, target); 511 mouseEvent, canvasRegionId, target);
511 result = EventHandlingUtil::mergeEventResult(clickEventResult, result); 512 result = EventHandlingUtil::mergeEventResult(clickEventResult, result);
512 }
513 } 513 }
514 514
515 if (pointerEvent->type() == EventTypeNames::pointerup || 515 if (pointerEvent->type() == EventTypeNames::pointerup ||
516 pointerEvent->type() == EventTypeNames::pointercancel) { 516 pointerEvent->type() == EventTypeNames::pointercancel) {
517 releasePointerCapture(pointerEvent->pointerId()); 517 releasePointerCapture(pointerEvent->pointerId());
518 // Send got/lostpointercapture rightaway if necessary. 518 // Send got/lostpointercapture rightaway if necessary.
519 processPendingPointerCapture(pointerEvent); 519 processPendingPointerCapture(pointerEvent);
520 520
521 if (pointerEvent->isPrimary()) { 521 if (pointerEvent->isPrimary()) {
522 m_preventMouseEventForPointerType[toPointerTypeIndex( 522 m_preventMouseEventForPointerType[toPointerTypeIndex(
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 if (firstId > uniqueTouchEventId) 717 if (firstId > uniqueTouchEventId)
718 return false; 718 return false;
719 m_touchIdsForCanceledPointerdowns.takeFirst(); 719 m_touchIdsForCanceledPointerdowns.takeFirst();
720 if (firstId == uniqueTouchEventId) 720 if (firstId == uniqueTouchEventId)
721 return true; 721 return true;
722 } 722 }
723 return false; 723 return false;
724 } 724 }
725 725
726 } // namespace blink 726 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/MouseEventManager.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698