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) { |