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

Unified Diff: third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp

Issue 2585353002: Detach Event Listener Properties before moving Node. (Closed)
Patch Set: Remove event listener properties before node.document() changes. Created 3 years, 11 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: third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
diff --git a/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp b/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
index 8600f7773cf3b11aa8b994cf5d819644ce31eddf..6edd1da5ce890c9c2071d4330c9a780ac63490e2 100644
--- a/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
@@ -52,6 +52,10 @@ void TreeScopeAdopter::moveTreeToNewScope(Node& root) const {
oldDocument.incDOMTreeVersion();
for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) {
+ // Before node.document() changes, allow the node to do pre-move changes.
bokan 2017/01/12 16:54:48 Please add a comment in TreeScopeAdopter::moveNode
wjmaclean 2017/01/13 17:40:30 Done.
+ if (willMoveToNewDocument)
+ node.willMoveToNewDocument();
+
updateTreeScope(node);
if (willMoveToNewDocument) {

Powered by Google App Engine
This is Rietveld 408576698