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

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

Issue 1305733002: Fix for calculation of event.path for closed mode shadow root (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: isUnclosedTreeOf() Created 5 years, 4 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/events/EventPath.h ('k') | Source/core/events/TreeScopeEventContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/EventPath.cpp
diff --git a/Source/core/events/EventPath.cpp b/Source/core/events/EventPath.cpp
index bfdee9e9f1a18e49ec985885eb6e375d6fec6501..153b3e90478b6d077d3428bede41466661d85762 100644
--- a/Source/core/events/EventPath.cpp
+++ b/Source/core/events/EventPath.cpp
@@ -94,7 +94,7 @@ void EventPath::initialize()
return;
calculatePath();
calculateAdjustedTargets();
- calculateTreeScopePrePostOrderNumbers();
+ calculateTreeOrderAndSetNearestAncestorClosedTree();
}
void EventPath::calculatePath()
@@ -155,7 +155,7 @@ void EventPath::calculatePath()
}
}
-void EventPath::calculateTreeScopePrePostOrderNumbers()
+void EventPath::calculateTreeOrderAndSetNearestAncestorClosedTree()
{
// Precondition:
// - TreeScopes in m_treeScopeEventContexts must be *connected* in the same tree of trees.
@@ -166,7 +166,8 @@ void EventPath::calculateTreeScopePrePostOrderNumbers()
TreeScopeEventContext* rootTree = 0;
for (const auto& treeScopeEventContext : m_treeScopeEventContexts) {
// Use olderShadowRootOrParentTreeScope here for parent-child relationships.
- // See the definition of trees of trees in the Shado DOM spec: http://w3c.github.io/webcomponents/spec/shadow/
+ // See the definition of trees of trees in the Shadow DOM spec:
+ // http://w3c.github.io/webcomponents/spec/shadow/
TreeScope* parent = treeScopeEventContext.get()->treeScope().olderShadowRootOrParentTreeScope();
if (!parent) {
ASSERT(!rootTree);
@@ -177,7 +178,7 @@ void EventPath::calculateTreeScopePrePostOrderNumbers()
treeScopeEventContextMap.find(parent)->value->addChild(*treeScopeEventContext.get());
}
ASSERT(rootTree);
- rootTree->calculatePrePostOrderNumber(0);
+ rootTree->calculateTreeOrderAndSetNearestAncestorClosedTree(0, nullptr);
}
TreeScopeEventContext* EventPath::ensureTreeScopeEventContext(Node* currentTarget, TreeScope* treeScope, TreeScopeEventContextMap& treeScopeEventContextMap)
« no previous file with comments | « Source/core/events/EventPath.h ('k') | Source/core/events/TreeScopeEventContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698