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

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

Issue 182683002: Lazy evaluation of event.path by numbering TreeScopes in DFS order for later O(1) queries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: One more renaming Created 6 years, 9 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/events/Event.cpp
diff --git a/Source/core/events/Event.cpp b/Source/core/events/Event.cpp
index 1111b1570713cfa484a2178ec37244750c237fad..043b3051f2613fe8d9d16628a60845e85084ffc4 100644
--- a/Source/core/events/Event.cpp
+++ b/Source/core/events/Event.cpp
@@ -202,11 +202,13 @@ PassRefPtr<NodeList> Event::path() const
if (!m_currentTarget || !m_currentTarget->toNode())
return StaticNodeList::createEmpty();
Node* node = m_currentTarget->toNode();
+ // FIXME: Support SVG Elements.
+ if (node->isSVGElement())
+ return StaticNodeList::createEmpty();
size_t eventPathSize = m_eventPath->size();
for (size_t i = 0; i < eventPathSize; ++i) {
if (node == (*m_eventPath)[i].node()) {
- ASSERT((*m_eventPath)[i].eventPath());
- return (*m_eventPath)[i].eventPath();
+ return (*m_eventPath)[i].treeScopeEventContext()->ensureEventPath(*m_eventPath);
}
}
return StaticNodeList::createEmpty();
« no previous file with comments | « PerformanceTests/Events/EventsDispatchingInDeeplyNestedShadowTrees.html ('k') | Source/core/events/EventPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698