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

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

Issue 2585353002: Detach Event Listener Properties before moving Node. (Closed)
Patch Set: Use more sensible checks. 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..bea9098bde06a1012d2d3b9ff18b6ce096669652 100644
--- a/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
@@ -128,6 +128,8 @@ inline void TreeScopeAdopter::moveNodeToNewDocument(
Document& oldDocument,
Document& newDocument) const {
DCHECK_NE(oldDocument, newDocument);
+ // Note: at the start of this function, node.document() may already have
+ // changed to match |newDocument|, which is why |oldDocument| is passed in.
if (node.hasRareData()) {
NodeRareData* rareData = node.rareData();
@@ -135,6 +137,7 @@ inline void TreeScopeAdopter::moveNodeToNewDocument(
rareData->nodeLists()->adoptDocument(oldDocument, newDocument);
}
+ node.willMoveToNewDocument(oldDocument, newDocument);
oldDocument.moveNodeIteratorsToNewDocument(node, newDocument);
if (node.getCustomElementState() == CustomElementState::Custom) {
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | third_party/WebKit/Source/core/frame/EventHandlerRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698