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/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 Loading... |
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 } | |
506 | 505 |
507 if (selectionOverLink && mouseEventType == EventTypeNames::mouseup) { | 506 if (selectionOverLink && mouseTarget && |
508 WebInputEventResult clickEventResult = | 507 mouseEventType == EventTypeNames::mouseup) { |
509 m_mouseEventManager->dispatchMouseClickIfNeeded( | 508 WebInputEventResult clickEventResult = |
510 pointerEventTarget ? pointerEventTarget->toNode() : nullptr, | 509 m_mouseEventManager->dispatchMouseClickIfNeeded( |
511 mouseEvent, canvasRegionId, target); | 510 mouseTarget->toNode(), mouseEvent, canvasRegionId, target); |
512 result = EventHandlingUtil::mergeEventResult(clickEventResult, result); | 511 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 Loading... |
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 |
OLD | NEW |