summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/TreeScopeAdopter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/TreeScopeAdopter.cpp')
-rw-r--r--Source/WebCore/dom/TreeScopeAdopter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/WebCore/dom/TreeScopeAdopter.cpp b/Source/WebCore/dom/TreeScopeAdopter.cpp
index 3601e0859..1dfb5cef5 100644
--- a/Source/WebCore/dom/TreeScopeAdopter.cpp
+++ b/Source/WebCore/dom/TreeScopeAdopter.cpp
@@ -49,7 +49,9 @@ void TreeScopeAdopter::moveTreeToNewScope(Node* root) const
oldDocument->incDOMTreeVersion();
for (Node* node = root; node; node = node->traverseNextNode(root)) {
- if (NodeRareData* rareData = node->setTreeScope(newDocument == m_newScope ? 0 : m_newScope)) {
+ node->setTreeScope(m_newScope);
+ if (node->hasRareData()) {
+ NodeRareData* rareData = node->rareData();
if (rareData->nodeLists())
rareData->nodeLists()->adoptTreeScope(oldDocument, newDocument);
if (node->isElementNode())
@@ -96,8 +98,6 @@ inline void TreeScopeAdopter::moveNodeToNewDocument(Node* node, Document* oldDoc
if (oldDocument)
oldDocument->moveNodeIteratorsToNewDocument(node, newDocument);
- node->setDocument(newDocument);
-
#ifndef NDEBUG
didMoveToNewDocumentWasCalled = false;
oldDocumentDidMoveToNewDocumentWasCalledWith = oldDocument;