Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index f8d2de1a09bec550aed51295f19009f354839eef..0e09a0524b3c673b576661847c381d5f5a894396 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -2275,12 +2275,14 @@ void Document::implicitClose() |
| if (f) |
| f->animation()->resumeAnimationsForDocument(this); |
| - ImageLoader::dispatchPendingBeforeLoadEvents(); |
| - ImageLoader::dispatchPendingLoadEvents(); |
| - ImageLoader::dispatchPendingErrorEvents(); |
| + if (!f || f->script()->canExecuteScripts(NotAboutToExecuteScript)) { |
|
Nate Chapin
2013/06/25 20:43:22
Should we be firing events for a detached document
|
| + ImageLoader::dispatchPendingBeforeLoadEvents(); |
| + ImageLoader::dispatchPendingLoadEvents(); |
| + ImageLoader::dispatchPendingErrorEvents(); |
| - HTMLLinkElement::dispatchPendingLoadEvents(); |
| - HTMLStyleElement::dispatchPendingLoadEvents(); |
| + HTMLLinkElement::dispatchPendingLoadEvents(); |
| + HTMLStyleElement::dispatchPendingLoadEvents(); |
| + } |
| // To align the HTML load event and the SVGLoad event for the outermost <svg> element, fire it from |
| // here, instead of doing it from SVGElement::finishedParsingChildren (if externalResourcesRequired="false", |