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

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

Issue 2585353002: Detach Event Listener Properties before moving Node. (Closed)
Patch Set: Use oldDocument instead of node's document() when deregistering event handlers. 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..d50eea1ba8022fff3262c09eea13246d49a12692 100644
--- a/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
@@ -135,6 +135,10 @@ inline void TreeScopeAdopter::moveNodeToNewDocument(
rareData->nodeLists()->adoptDocument(oldDocument, newDocument);
}
+ // TODO(wjmaclean): It seems weird here that oldDocument !=(in general)
+ // node.document(). I'd like to understand why, as it seems clinky passing
+ // oldDocument in the call to node.willMoveToNewDocument().
bokan 2017/01/04 23:33:27 This was the first question I had above, why can't
+ node.willMoveToNewDocument(oldDocument);
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