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

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

Issue 12178024: Merge 141198 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 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
Index: Source/WebCore/dom/ContainerNode.cpp
===================================================================
--- Source/WebCore/dom/ContainerNode.cpp (revision 141792)
+++ Source/WebCore/dom/ContainerNode.cpp (working copy)
@@ -313,6 +313,9 @@
if (nextChild->previousSibling() == newChild || nextChild == newChild) // nothing to do
return;
+ if (document() != newChild->document())
+ document()->adoptNode(newChild.get(), ASSERT_NO_EXCEPTION);
+
insertBeforeCommon(nextChild, newChild.get());
childrenChanged(true, newChild->previousSibling(), nextChild, 1);
@@ -685,8 +688,10 @@
ASSERT(newChild);
ASSERT(!newChild->parentNode()); // Use appendChild if you need to handle reparenting (and want DOM mutation events).
ASSERT(!newChild->isDocumentFragment());
- ASSERT(document() == newChild->document());
+ if (document() != newChild->document())
+ document()->adoptNode(newChild.get(), ASSERT_NO_EXCEPTION);
+
Node* last = m_lastChild;
{
NoEventDispatchAssertion assertNoEventDispatch;
« no previous file with comments | « LayoutTests/fast/parser/xml-error-adopted-expected.txt ('k') | Source/WebCore/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698