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

Unified Diff: Source/core/dom/EventContext.h

Issue 14508005: Support an Event Path API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Introduce TreeScope::isInclusiveAncestorOf Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Event.idl ('k') | Source/core/dom/EventContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/EventContext.h
diff --git a/Source/core/dom/EventContext.h b/Source/core/dom/EventContext.h
index 0a21f59e218372375bce3091487ed5f4b26bf740..5017e5ca2073711e720c587c86c3937837d49cf7 100644
--- a/Source/core/dom/EventContext.h
+++ b/Source/core/dom/EventContext.h
@@ -53,7 +53,6 @@ public:
protected:
#ifndef NDEBUG
bool isUnreachableNode(EventTarget*);
- bool isReachable(Node*) const;
#endif
RefPtr<Node> m_node;
RefPtr<EventTarget> m_currentTarget;
@@ -107,18 +106,7 @@ inline TouchEventContext* toTouchEventContext(EventContext* eventContext)
inline bool EventContext::isUnreachableNode(EventTarget* target)
{
// FIXME: Checks also for SVG elements.
- return target && target->toNode() && !target->toNode()->isSVGElement() && !isReachable(target->toNode());
-}
-
-inline bool EventContext::isReachable(Node* target) const
-{
- ASSERT(target);
- TreeScope* targetScope = target->treeScope();
- for (TreeScope* scope = m_node->treeScope(); scope; scope = scope->parentTreeScope()) {
- if (scope == targetScope)
- return true;
- }
- return false;
+ return target && target->toNode() && !target->toNode()->isSVGElement() && !target->toNode()->treeScope()->isInclusiveAncestorOf(m_node->treeScope());
}
#endif
« no previous file with comments | « Source/core/dom/Event.idl ('k') | Source/core/dom/EventContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698