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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
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/shadow/FlatTreeTraversal.h" 7 #include "core/dom/shadow/FlatTreeTraversal.h"
8 #include "core/events/MouseEvent.h" 8 #include "core/events/MouseEvent.h"
9 #include "core/input/EventHandler.h" 9 #include "core/input/EventHandler.h"
10 10
(...skipping 15 matching lines...) Expand all
26 case PlatformTouchPoint::TouchStationary: 26 case PlatformTouchPoint::TouchStationary:
27 // Fall through to default 27 // Fall through to default
28 default: 28 default:
29 ASSERT_NOT_REACHED(); 29 ASSERT_NOT_REACHED();
30 return emptyAtom; 30 return emptyAtom;
31 } 31 }
32 } 32 }
33 33
34 bool isInDocument(RawPtr<EventTarget> n) 34 bool isInDocument(RawPtr<EventTarget> n)
35 { 35 {
36 return n && n->toNode() && n->toNode()->inDocument(); 36 return n && n->toNode() && n->toNode()->inShadowIncludingDocument();
37 } 37 }
38 38
39 WebInputEventResult dispatchMouseEvent( 39 WebInputEventResult dispatchMouseEvent(
40 RawPtr<EventTarget> prpTarget, 40 RawPtr<EventTarget> prpTarget,
41 const AtomicString& mouseEventType, 41 const AtomicString& mouseEventType,
42 const PlatformMouseEvent& mouseEvent, 42 const PlatformMouseEvent& mouseEvent,
43 RawPtr<EventTarget> prpRelatedTarget, 43 RawPtr<EventTarget> prpRelatedTarget,
44 int detail = 0, 44 int detail = 0,
45 bool checkForListener = false) 45 bool checkForListener = false)
46 { 46 {
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 pointerEvent); 478 pointerEvent);
479 } 479 }
480 sendNodeTransitionEvents(nodeUnderPointerAtt.target, nullptr, 480 sendNodeTransitionEvents(nodeUnderPointerAtt.target, nullptr,
481 pointerEvent, mouseEvent, sendMouseEvent); 481 pointerEvent, mouseEvent, sendMouseEvent);
482 } 482 }
483 if (pointerCaptureTarget) { 483 if (pointerCaptureTarget) {
484 // Re-target lostpointercapture to the document when the element is 484 // Re-target lostpointercapture to the document when the element is
485 // no longer participating in the tree. 485 // no longer participating in the tree.
486 EventTarget* target = pointerCaptureTarget.get(); 486 EventTarget* target = pointerCaptureTarget.get();
487 if (target->toNode() 487 if (target->toNode()
488 && !target->toNode()->inDocument()) { 488 && !target->toNode()->inShadowIncludingDocument()) {
489 target = target->toNode()->ownerDocument(); 489 target = target->toNode()->ownerDocument();
490 } 490 }
491 dispatchPointerEvent(target, 491 dispatchPointerEvent(target,
492 m_pointerEventFactory.createPointerCaptureEvent( 492 m_pointerEventFactory.createPointerCaptureEvent(
493 pointerEvent, EventTypeNames::lostpointercapture)); 493 pointerEvent, EventTypeNames::lostpointercapture));
494 } 494 }
495 } 495 }
496 496
497 // Set pointerCaptureTarget from pendingPointerCaptureTarget. This does 497 // Set pointerCaptureTarget from pendingPointerCaptureTarget. This does
498 // affect the behavior of sendNodeTransitionEvents function. So the 498 // affect the behavior of sendNodeTransitionEvents function. So the
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 591
592 DEFINE_TRACE(PointerEventManager) 592 DEFINE_TRACE(PointerEventManager)
593 { 593 {
594 visitor->trace(m_nodeUnderPointer); 594 visitor->trace(m_nodeUnderPointer);
595 visitor->trace(m_pointerCaptureTarget); 595 visitor->trace(m_pointerCaptureTarget);
596 visitor->trace(m_pendingPointerCaptureTarget); 596 visitor->trace(m_pendingPointerCaptureTarget);
597 } 597 }
598 598
599 599
600 } // namespace blink 600 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698