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

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

Issue 159913004: Stop handling the case where oldDocument and newDocument are the same in adoptDocument() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/core/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/core/dom/TreeScopeAdopter.cpp
diff --git a/Source/core/dom/TreeScopeAdopter.cpp b/Source/core/dom/TreeScopeAdopter.cpp
index 4fe3ed178129bfddf7f3ff023c5f95b4eac84c1a..109d47ce4c123db51d7e1eae8fc208f3e5e68afc 100644
--- a/Source/core/dom/TreeScopeAdopter.cpp
+++ b/Source/core/dom/TreeScopeAdopter.cpp
@@ -82,6 +82,7 @@ void TreeScopeAdopter::moveTreeToNewScope(Node& root) const
void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument, Document& newDocument) const
{
+ ASSERT(oldDocument != newDocument);
for (Node* node = &root; node; node = NodeTraversal::next(*node, &root)) {
moveNodeToNewDocument(*node, oldDocument, newDocument);
for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot())
@@ -112,7 +113,7 @@ inline void TreeScopeAdopter::updateTreeScope(Node& node) const
inline void TreeScopeAdopter::moveNodeToNewDocument(Node& node, Document& oldDocument, Document& newDocument) const
{
- ASSERT(!node.inDocument() || oldDocument != newDocument);
+ ASSERT(oldDocument != newDocument);
if (node.hasRareData()) {
NodeRareData* rareData = node.rareData();
« no previous file with comments | « Source/core/dom/NodeRareData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698