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

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: event.path() now returns a different view for each node. 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
Index: Source/core/dom/EventContext.h
diff --git a/Source/core/dom/EventContext.h b/Source/core/dom/EventContext.h
index 0a21f59e218372375bce3091487ed5f4b26bf740..e76cf2c3cee6e63fe82d03f212e70ea85c70fa71 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() && !m_node->canReach(target->toNode());
}
#endif

Powered by Google App Engine
This is Rietveld 408576698