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

Unified Diff: Source/core/dom/Document.cpp

Issue 17682003: Do not fire load events from frames with scripting disabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Do not send events for detached documents Created 7 years, 6 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 | « LayoutTests/fast/images/image-load-event-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index f8d2de1a09bec550aed51295f19009f354839eef..e55ea85204d0fb7c4ef4e951607fd3d934be500a 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)) {
+ 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",
« no previous file with comments | « LayoutTests/fast/images/image-load-event-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698