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

Unified Diff: Source/core/dom/NodeRareData.h

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 | « no previous file | Source/core/dom/TreeScopeAdopter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeRareData.h
diff --git a/Source/core/dom/NodeRareData.h b/Source/core/dom/NodeRareData.h
index b1474b90d435f31238f6ea728ea6715cdaa3cfeb..65f903c78e340d63339910aa936533b3acded7ce 100644
--- a/Source/core/dom/NodeRareData.h
+++ b/Source/core/dom/NodeRareData.h
@@ -173,23 +173,22 @@ public:
void adoptDocument(Document& oldDocument, Document& newDocument)
{
+ ASSERT(oldDocument != newDocument);
invalidateCaches();
- if (oldDocument != newDocument) {
- NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicNameCaches.end();
- for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begin(); it != atomicNameCacheEnd; ++it) {
- LiveNodeListBase* list = it->value;
- oldDocument.unregisterNodeList(list);
- newDocument.registerNodeList(list);
- }
-
- TagCollectionCacheNS::const_iterator tagEnd = m_tagCollectionCacheNS.end();
- for (TagCollectionCacheNS::const_iterator it = m_tagCollectionCacheNS.begin(); it != tagEnd; ++it) {
- LiveNodeListBase* list = it->value;
- ASSERT(!list->isRootedAtDocument());
- oldDocument.unregisterNodeList(list);
- newDocument.registerNodeList(list);
- }
+ NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicNameCaches.end();
+ for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begin(); it != atomicNameCacheEnd; ++it) {
+ LiveNodeListBase* list = it->value;
+ oldDocument.unregisterNodeList(list);
+ newDocument.registerNodeList(list);
+ }
+
+ TagCollectionCacheNS::const_iterator tagEnd = m_tagCollectionCacheNS.end();
+ for (TagCollectionCacheNS::const_iterator it = m_tagCollectionCacheNS.begin(); it != tagEnd; ++it) {
+ LiveNodeListBase* list = it->value;
+ ASSERT(!list->isRootedAtDocument());
+ oldDocument.unregisterNodeList(list);
+ newDocument.registerNodeList(list);
}
}
« no previous file with comments | « no previous file | Source/core/dom/TreeScopeAdopter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698