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

Unified Diff: third_party/WebKit/Source/core/input/BoundaryEventDispatcher.cpp

Issue 2845973002: Merge two IsInDocument implementations. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandlingUtil.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/input/BoundaryEventDispatcher.cpp
diff --git a/third_party/WebKit/Source/core/input/BoundaryEventDispatcher.cpp b/third_party/WebKit/Source/core/input/BoundaryEventDispatcher.cpp
index 7c15d9cbc924ab67f56e007f6da0a5b968819a1b..2a361e2e3cceed5661a78f85397277afadc63af2 100644
--- a/third_party/WebKit/Source/core/input/BoundaryEventDispatcher.cpp
+++ b/third_party/WebKit/Source/core/input/BoundaryEventDispatcher.cpp
@@ -6,18 +6,15 @@
#include "core/dom/Node.h"
#include "core/dom/shadow/FlatTreeTraversal.h"
+#include "core/input/EventHandlingUtil.h"
namespace blink {
namespace {
-bool IsInDocument(EventTarget* target) {
- return target && target->ToNode() && target->ToNode()->isConnected();
-}
-
void BuildAncestorChain(EventTarget* target,
HeapVector<Member<Node>, 20>* ancestors) {
- if (!IsInDocument(target))
+ if (!EventHandlingUtil::IsInDocument(target))
return;
Node* target_node = target->ToNode();
DCHECK(target_node);
@@ -65,7 +62,7 @@ void BoundaryEventDispatcher::SendBoundaryEvents(EventTarget* exited_target,
return;
// Dispatch out event
- if (IsInDocument(exited_target))
+ if (EventHandlingUtil::IsInDocument(exited_target))
DispatchOut(exited_target, entered_target);
// Create lists of all exited/entered ancestors, locate the common ancestor
@@ -115,7 +112,7 @@ void BoundaryEventDispatcher::SendBoundaryEvents(EventTarget* exited_target,
!exited_node_has_capturing_ancestor);
// Dispatch over event
- if (IsInDocument(entered_target))
+ if (EventHandlingUtil::IsInDocument(entered_target))
DispatchOver(entered_target, exited_target);
// Defer locating capturing enter listener until /after/ dispatching the leave
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandlingUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698