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

Unified Diff: Source/core/dom/Event.cpp

Issue 15063004: Make Event.path() return a pre-calculated NodeList rather than calculating it dynamically. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add an include. 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/Event.cpp
diff --git a/Source/core/dom/Event.cpp b/Source/core/dom/Event.cpp
index de51a3f403605a7fa7e5735ad608fbdbe0b818d7..4fc43306807fcafab1fa116c1091e23ebd69a45a 100644
--- a/Source/core/dom/Event.cpp
+++ b/Source/core/dom/Event.cpp
@@ -206,16 +206,15 @@ PassRefPtr<NodeList> Event::path() const
{
if (!m_currentTarget || !m_currentTarget->toNode())
return StaticNodeList::createEmpty();
- TreeScope* currentScope = m_currentTarget->toNode()->treeScope();
- Vector<RefPtr<Node> > nodes;
+ Node* node = m_currentTarget->toNode();
size_t eventPathSize = m_eventPath.size();
for (size_t i = 0; i < eventPathSize; ++i) {
- Node* node = m_eventPath[i]->node();
- ASSERT(node);
- if (node->treeScope()->isInclusiveAncestorOf(currentScope))
- nodes.append(node);
+ if (node == m_eventPath[i]->node()) {
+ ASSERT(m_eventPath[i]->eventPath());
+ return m_eventPath[i]->eventPath();
+ }
}
- return StaticNodeList::adopt(nodes);
+ return StaticNodeList::createEmpty();
}
} // namespace WebCore
« no previous file with comments | « LayoutTests/fast/dom/shadow/event-path-with-dom-mutation-expected.txt ('k') | Source/core/dom/EventContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698