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

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: refactored 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
« no previous file with comments | « Source/core/dom/ScriptRunner.cpp ('k') | Source/core/svg/SVGScriptElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLScriptElement.cpp
diff --git a/Source/core/html/HTMLScriptElement.cpp b/Source/core/html/HTMLScriptElement.cpp
index d429566d61384e6d8863194220a569b943ce31e2..5cd1422f460b42fe1d5eb487c996eb1034e800b3 100644
--- a/Source/core/html/HTMLScriptElement.cpp
+++ b/Source/core/html/HTMLScriptElement.cpp
@@ -73,22 +73,7 @@ void HTMLScriptElement::childrenChanged(const ChildrenChange& change)
void HTMLScriptElement::didMoveToNewDocument(Document& oldDocument)
{
- RefPtrWillBeRawPtr<Document> contextDocument = document().contextDocument().get();
- if (!contextDocument) {
- // Document's contextDocument() method will return no Document if the
- // following conditions both hold:
- //
- // - The Document wasn't created with an explicit context document
- // and that document is otherwise kept alive.
- // - The Document itself is detached from its frame.
- //
- // The script element's loader is in that case moved to document() and
- // its script runner, which is the non-null Document that contextDocument()
- // would return if not detached.
- ASSERT(!document().frame());
- contextDocument = &document();
- }
- oldDocument.scriptRunner()->movePendingAsyncScript(contextDocument->scriptRunner(), m_loader.get());
+ ScriptRunner::movePendingAsyncScript(oldDocument, document(), m_loader.get());
HTMLElement::didMoveToNewDocument(oldDocument);
}
« no previous file with comments | « Source/core/dom/ScriptRunner.cpp ('k') | Source/core/svg/SVGScriptElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698