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

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

Issue 6709024: Merge 80797 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 9 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/Document.cpp ('k') | Source/WebCore/html/FormAssociatedElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Node.cpp
===================================================================
--- Source/WebCore/dom/Node.cpp (revision 81450)
+++ Source/WebCore/dom/Node.cpp (working copy)
@@ -758,6 +758,13 @@
if (this->document() == document || this->inDocument())
return;
+ // If an element is moved from a document and then eventually back again the collection cache for
+ // that element may contain stale data as changes made to it will have updated the DOMTreeVersion
+ // of the document it was moved to. By increasing the DOMTreeVersion of the donating document here
+ // we ensure that the collection cache will be invalidated as needed when the element is moved back.
+ if (this->document())
+ this->document()->incDOMTreeVersion();
+
for (Node* node = this; node; node = node->traverseNextNode(this)) {
node->setDocument(document);
if (!node->isElementNode())
« no previous file with comments | « Source/WebCore/dom/Document.cpp ('k') | Source/WebCore/html/FormAssociatedElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698