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

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

Issue 2555743005: Add iterator support to blink::EventPath. (Closed)
Patch Set: Exposed the vector Created 4 years 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/events/TreeScopeEventContext.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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 mouseEvent.pointerProperties().pointerType)] = true; 474 mouseEvent.pointerProperties().pointerType)] = true;
475 } 475 }
476 476
477 if (pointerEvent->isPrimary() && 477 if (pointerEvent->isPrimary() &&
478 !m_preventMouseEventForPointerType[toPointerTypeIndex( 478 !m_preventMouseEventForPointerType[toPointerTypeIndex(
479 mouseEvent.pointerProperties().pointerType)]) { 479 mouseEvent.pointerProperties().pointerType)]) {
480 EventTarget* mouseTarget = effectiveTarget; 480 EventTarget* mouseTarget = effectiveTarget;
481 // Event path could be null if pointer event is not dispatched and 481 // Event path could be null if pointer event is not dispatched and
482 // that happens for example when pointer event feature is not enabled. 482 // that happens for example when pointer event feature is not enabled.
483 if (!isInDocument(mouseTarget) && pointerEvent->hasEventPath()) { 483 if (!isInDocument(mouseTarget) && pointerEvent->hasEventPath()) {
484 for (size_t i = 0; i < pointerEvent->eventPath().size(); i++) { 484 for (const auto& context :
485 if (isInDocument(pointerEvent->eventPath()[i].node())) { 485 pointerEvent->eventPath().nodeEventContexts()) {
486 mouseTarget = pointerEvent->eventPath()[i].node(); 486 if (isInDocument(context.node())) {
487 mouseTarget = context.node();
487 break; 488 break;
488 } 489 }
489 } 490 }
490 } 491 }
491 result = EventHandlingUtil::mergeEventResult( 492 result = EventHandlingUtil::mergeEventResult(
492 result, m_mouseEventManager->dispatchMouseEvent( 493 result, m_mouseEventManager->dispatchMouseEvent(
493 mouseTarget, mouseEventType, mouseEvent, nullptr)); 494 mouseTarget, mouseEventType, mouseEvent, nullptr));
494 } 495 }
495 496
496 if (pointerEvent->type() == EventTypeNames::pointerup || 497 if (pointerEvent->type() == EventTypeNames::pointerup ||
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 return true; 696 return true;
696 } 697 }
697 return false; 698 return false;
698 } 699 }
699 700
700 EventTarget* PointerEventManager::getMouseCapturingNode() { 701 EventTarget* PointerEventManager::getMouseCapturingNode() {
701 return getCapturingNode(PointerEventFactory::s_mouseId); 702 return getCapturingNode(PointerEventFactory::s_mouseId);
702 } 703 }
703 704
704 } // namespace blink 705 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/TreeScopeEventContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698