| Index: Source/core/html/HTMLScriptElement.cpp
|
| diff --git a/Source/core/html/HTMLScriptElement.cpp b/Source/core/html/HTMLScriptElement.cpp
|
| index d429566d61384e6d8863194220a569b943ce31e2..5a938efa8a33efafeb26925f811c21df03387718 100644
|
| --- a/Source/core/html/HTMLScriptElement.cpp
|
| +++ b/Source/core/html/HTMLScriptElement.cpp
|
| @@ -88,7 +88,11 @@ void HTMLScriptElement::didMoveToNewDocument(Document& oldDocument)
|
| ASSERT(!document().frame());
|
| contextDocument = &document();
|
| }
|
| - oldDocument.scriptRunner()->movePendingAsyncScript(contextDocument->scriptRunner(), m_loader.get());
|
| + RefPtrWillBeRawPtr<Document> oldContextDocument = oldDocument.contextDocument().get();
|
| + if (!oldContextDocument)
|
| + oldContextDocument = &oldDocument;
|
| + if (oldContextDocument != contextDocument)
|
| + oldContextDocument->scriptRunner()->movePendingAsyncScript(contextDocument->scriptRunner(), m_loader.get());
|
| HTMLElement::didMoveToNewDocument(oldDocument);
|
| }
|
|
|
|
|