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

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

Issue 532643002: Move pending async script to the correct resolved document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update expected outputs. Created 6 years, 3 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 b95da30566f265e2ee01c80206b1bf2fb71d00ee..d9cbb807932fd94953cdd369c50532709825225c 100644
--- a/Source/core/html/HTMLScriptElement.cpp
+++ b/Source/core/html/HTMLScriptElement.cpp
@@ -73,7 +73,8 @@ void HTMLScriptElement::childrenChanged(const ChildrenChange& change)
void HTMLScriptElement::didMoveToNewDocument(Document& oldDocument)
{
- oldDocument.scriptRunner()->movePendingAsyncScript(document().scriptRunner(), m_loader.get());
+ if (RefPtrWillBeRawPtr<Document> contextDocument = document().contextDocument().get())
+ oldDocument.scriptRunner()->movePendingAsyncScript(contextDocument->scriptRunner(), m_loader.get());
HTMLElement::didMoveToNewDocument(oldDocument);
}
« no previous file with comments | « LayoutTests/fast/dom/HTMLScriptElement/resources/should-load.js ('k') | Source/core/svg/SVGScriptElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698