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

Unified Diff: Source/core/html/HTMLScriptElement.cpp

Issue 913473002: Testing a fix to crbug.com/456059. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: oops Created 5 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698