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

Unified Diff: Source/WebCore/dom/TreeScopeAdopter.cpp

Issue 12052069: Merge 140103 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 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
« no previous file with comments | « Source/WebCore/dom/NodeRareData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/TreeScopeAdopter.cpp
===================================================================
--- Source/WebCore/dom/TreeScopeAdopter.cpp (revision 140739)
+++ Source/WebCore/dom/TreeScopeAdopter.cpp (working copy)
@@ -51,15 +51,14 @@
for (Node* node = root; node; node = NodeTraversal::next(node, root)) {
node->setTreeScope(m_newScope);
- if (node->hasRareData()) {
+ if (willMoveToNewDocument)
+ moveNodeToNewDocument(node, oldDocument, newDocument);
+ else if (node->hasRareData()) {
NodeRareData* rareData = node->rareData();
if (rareData->nodeLists())
- rareData->nodeLists()->adoptTreeScope(oldDocument, newDocument);
+ rareData->nodeLists()->adoptTreeScope();
}
- if (willMoveToNewDocument)
- moveNodeToNewDocument(node, oldDocument, newDocument);
-
for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot()) {
shadow->setParentTreeScope(m_newScope);
if (willMoveToNewDocument)
@@ -93,6 +92,12 @@
{
ASSERT(!node->inDocument() || oldDocument != newDocument);
+ if (node->hasRareData()) {
+ NodeRareData* rareData = node->rareData();
+ if (rareData->nodeLists())
+ rareData->nodeLists()->adoptDocument(oldDocument, newDocument);
+ }
+
newDocument->guardRef();
if (oldDocument)
oldDocument->moveNodeIteratorsToNewDocument(node, newDocument);
« no previous file with comments | « Source/WebCore/dom/NodeRareData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698