Index: Source/WebCore/html/parser/HTMLConstructionSite.cpp |
=================================================================== |
--- Source/WebCore/html/parser/HTMLConstructionSite.cpp (revision 141140) |
+++ Source/WebCore/html/parser/HTMLConstructionSite.cpp (working copy) |
@@ -391,6 +391,10 @@ |
currentPosition += textNode->length(); |
ASSERT(currentPosition <= characters.length()); |
task.child = textNode.release(); |
+ |
+ if (task.parent->document() != task.child->document()) |
+ task.parent->document()->adoptNode(task.child, ASSERT_NO_EXCEPTION); |
+ |
executeTask(task); |
} |
} |
@@ -522,6 +526,10 @@ |
findFosterSite(task); |
task.child = node; |
ASSERT(task.parent); |
+ |
+ if (task.parent->document() != task.child->document()) |
+ task.parent->document()->adoptNode(task.child, ASSERT_NO_EXCEPTION); |
+ |
m_attachmentQueue.append(task); |
} |