Index: Source/WebCore/dom/TreeScopeAdopter.cpp |
=================================================================== |
--- Source/WebCore/dom/TreeScopeAdopter.cpp (revision 122247) |
+++ Source/WebCore/dom/TreeScopeAdopter.cpp (working copy) |
@@ -53,12 +53,8 @@ |
for (Node* node = root; node; node = node->traverseNextNode(root)) { |
NodeRareData* rareData = node->setTreeScope(newDocument == m_newScope ? 0 : m_newScope); |
- if (rareData && rareData->nodeLists()) { |
- rareData->nodeLists()->invalidateCaches(); |
- if (m_oldScope) |
- m_oldScope->removeNodeListCache(); |
- m_newScope->addNodeListCache(); |
- } |
+ if (rareData && rareData->nodeLists()) |
+ rareData->nodeLists()->adoptTreeScope(m_oldScope, m_newScope, oldDocument, newDocument); |
if (willMoveToNewDocument) |
moveNodeToNewDocument(node, oldDocument, newDocument); |