diff options
Diffstat (limited to 'Source/WebCore/loader/DocumentWriter.cpp')
-rw-r--r-- | Source/WebCore/loader/DocumentWriter.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/WebCore/loader/DocumentWriter.cpp b/Source/WebCore/loader/DocumentWriter.cpp index 442e3bf57..593c0a5e7 100644 --- a/Source/WebCore/loader/DocumentWriter.cpp +++ b/Source/WebCore/loader/DocumentWriter.cpp @@ -71,6 +71,12 @@ DocumentWriter::DocumentWriter(Frame* frame) void DocumentWriter::replaceDocument(const String& source, Document* ownerDocument) { m_frame->loader().stopAllLoaders(); + + // If we are in the midst of changing the frame's document, don't execute script + // that modifes the document further: + if (m_frame->documentIsBeingReplaced()) + return; + begin(m_frame->document()->url(), true, ownerDocument); // begin() might fire an unload event, which will result in a situation where no new document has been attached, |