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

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: 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 pointerEvent); 461 pointerEvent);
462 } 462 }
463 sendNodeTransitionEvents(nodeUnderPointerAtt.target, nullptr, 463 sendNodeTransitionEvents(nodeUnderPointerAtt.target, nullptr,
464 pointerEvent, mouseEvent, sendMouseEvent); 464 pointerEvent, mouseEvent, sendMouseEvent);
465 } 465 }
466 if (pointerCaptureTarget) { 466 if (pointerCaptureTarget) {
467 // Re-target lostpointercapture to the document when the element is 467 // Re-target lostpointercapture to the document when the element is
468 // no longer participating in the tree. 468 // no longer participating in the tree.
469 EventTarget* target = pointerCaptureTarget.get(); 469 EventTarget* target = pointerCaptureTarget.get();
470 if (target->toNode() 470 if (target->toNode()
471 && !target->toNode()->inDocument()) { 471 && !target->toNode()->inShadowIncludingDocument()) {
472 target = target->toNode()->ownerDocument(); 472 target = target->toNode()->ownerDocument();
473 } 473 }
474 dispatchPointerEvent(target, 474 dispatchPointerEvent(target,
475 m_pointerEventFactory.createPointerCaptureEvent( 475 m_pointerEventFactory.createPointerCaptureEvent(
476 pointerEvent, EventTypeNames::lostpointercapture)); 476 pointerEvent, EventTypeNames::lostpointercapture));
477 } 477 }
478 } 478 }
479 479
480 // Set pointerCaptureTarget from pendingPointerCaptureTarget. This does 480 // Set pointerCaptureTarget from pendingPointerCaptureTarget. This does
481 // affect the behavior of sendNodeTransitionEvents function. So the 481 // affect the behavior of sendNodeTransitionEvents function. So the
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 { 570 {
571 #if ENABLE(OILPAN) 571 #if ENABLE(OILPAN)
572 visitor->trace(m_nodeUnderPointer); 572 visitor->trace(m_nodeUnderPointer);
573 visitor->trace(m_pointerCaptureTarget); 573 visitor->trace(m_pointerCaptureTarget);
574 visitor->trace(m_pendingPointerCaptureTarget); 574 visitor->trace(m_pendingPointerCaptureTarget);
575 #endif 575 #endif
576 } 576 }
577 577
578 578
579 } // namespace blink 579 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698