| 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;
|
|
|