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

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

Issue 2845973002: Merge two IsInDocument implementations. (Closed)
Patch Set: Created 3 years, 7 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/EventHandlingUtil.h" 5 #include "core/input/EventHandlingUtil.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/layout/api/LayoutViewItem.h" 9 #include "core/layout/api/LayoutViewItem.h"
10 #include "core/paint/PaintLayer.h" 10 #include "core/paint/PaintLayer.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (!layout_object) 76 if (!layout_object)
77 return nullptr; 77 return nullptr;
78 78
79 PaintLayer* layer = layout_object->EnclosingLayer(); 79 PaintLayer* layer = layout_object->EnclosingLayer();
80 if (!layer) 80 if (!layer)
81 return nullptr; 81 return nullptr;
82 82
83 return layer; 83 return layer;
84 } 84 }
85 85
86 bool IsInDocument(EventTarget* n) {
87 return n && n->ToNode() && n->ToNode()->isConnected();
88 }
89
86 ScrollableArea* AssociatedScrollableArea(const PaintLayer* layer) { 90 ScrollableArea* AssociatedScrollableArea(const PaintLayer* layer) {
87 if (PaintLayerScrollableArea* scrollable_area = layer->GetScrollableArea()) { 91 if (PaintLayerScrollableArea* scrollable_area = layer->GetScrollableArea()) {
88 if (scrollable_area->ScrollsOverflow()) 92 if (scrollable_area->ScrollsOverflow())
89 return scrollable_area; 93 return scrollable_area;
90 } 94 }
91 95
92 return nullptr; 96 return nullptr;
93 } 97 }
94 98
95 ContainerNode* ParentForClickEvent(const Node& node) { 99 ContainerNode* ParentForClickEvent(const Node& node) {
(...skipping 23 matching lines...) Expand all
119 123
120 return frame->GetDocument()->PerformMouseEventHitTest( 124 return frame->GetDocument()->PerformMouseEventHitTest(
121 request, 125 request,
122 ContentPointFromRootFrame(frame, 126 ContentPointFromRootFrame(frame,
123 FlooredIntPoint(mev.PositionInRootFrame())), 127 FlooredIntPoint(mev.PositionInRootFrame())),
124 mev); 128 mev);
125 } 129 }
126 130
127 } // namespace EventHandlingUtil 131 } // namespace EventHandlingUtil
128 } // namespace blink 132 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandlingUtil.h ('k') | third_party/WebKit/Source/core/input/PointerEventManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698