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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 1620983002: Also transfer pending in-order scripts upon element moving to new document (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: also remove is-disposed checking; unnecessary Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 RefPtrWillBeRawPtr<Document> elementDocument(m_element->document()); 460 RefPtrWillBeRawPtr<Document> elementDocument(m_element->document());
461 RefPtrWillBeRawPtr<Document> contextDocument = elementDocument->contextDocum ent().get(); 461 RefPtrWillBeRawPtr<Document> contextDocument = elementDocument->contextDocum ent().get();
462 if (!contextDocument) 462 if (!contextDocument)
463 return; 463 return;
464 464
465 ASSERT_UNUSED(resource, resource == m_resource); 465 ASSERT_UNUSED(resource, resource == m_resource);
466 466
467 ScriptRunner::ExecutionType runOrder = m_willExecuteInOrder ? ScriptRunner:: IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION; 467 ScriptRunner::ExecutionType runOrder = m_willExecuteInOrder ? ScriptRunner:: IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION;
468 if (m_resource->errorOccurred()) { 468 if (m_resource->errorOccurred()) {
469 dispatchErrorEvent(); 469 dispatchErrorEvent();
470 // dispatchErrorEvent might move the HTMLScriptElement to a new 470 // The error handler can move the HTMLScriptElement to a new document.
471 // document. In that case, we must notify the ScriptRunner of the new 471 // In that case, we must notify the ScriptRunner of the new document,
472 // document, not the ScriptRunner of the old docuemnt. 472 // not the ScriptRunner of the old docuemnt.
473 contextDocument = m_element->document().contextDocument().get(); 473 contextDocument = m_element->document().contextDocument().get();
474 if (!contextDocument) 474 if (!contextDocument)
475 return; 475 return;
476 contextDocument->scriptRunner()->notifyScriptLoadError(this, runOrder); 476 contextDocument->scriptRunner()->notifyScriptLoadError(this, runOrder);
477 return; 477 return;
478 } 478 }
479 contextDocument->scriptRunner()->notifyScriptReady(this, runOrder); 479 contextDocument->scriptRunner()->notifyScriptReady(this, runOrder);
480 m_pendingScript->stopWatchingForLoad(this); 480 m_pendingScript->stopWatchingForLoad(this);
481 } 481 }
482 482
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 if (isHTMLScriptLoader(element)) 521 if (isHTMLScriptLoader(element))
522 return toHTMLScriptElement(element)->loader(); 522 return toHTMLScriptElement(element)->loader();
523 523
524 if (isSVGScriptLoader(element)) 524 if (isSVGScriptLoader(element))
525 return toSVGScriptElement(element)->loader(); 525 return toSVGScriptElement(element)->loader();
526 526
527 return 0; 527 return 0;
528 } 528 }
529 529
530 } // namespace blink 530 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698