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

Unified Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 18226005: Do not fire beforeload events from frames with scripting disabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Do not fire events when the parser is stopped Created 7 years, 5 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-beforeload-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/xml/parser/XMLDocumentParser.cpp
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index e58fd82fd92ab6192f2e8a19f4883f1af5c0f599..d3c85bf5333fd41df8a1a1bc65e9aa9d22892785 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -37,6 +37,7 @@
#include <wtf/Vector.h>
#include "HTMLNames.h"
#include "XMLNSNames.h"
+#include "bindings/v8/ScriptController.h"
#include "bindings/v8/ScriptSourceCode.h"
#include "core/dom/CDATASection.h"
#include "core/dom/Comment.h"
@@ -335,8 +336,11 @@ void XMLDocumentParser::append(PassRefPtr<StringImpl> inputSource)
doWrite(source.toString());
- // After parsing, go ahead and dispatch image beforeload events.
- ImageLoader::dispatchPendingBeforeLoadEvents();
+ if (isStopped())
+ return;
abarth-chromium 2013/07/10 21:33:08 LGTM
+
+ if (document()->frame() && document()->frame()->script()->canExecuteScripts(NotAboutToExecuteScript))
+ ImageLoader::dispatchPendingBeforeLoadEvents();
}
void XMLDocumentParser::handleError(XMLErrors::ErrorType type, const char* formattedMessage, TextPosition position)
« no previous file with comments | « LayoutTests/fast/images/image-beforeload-event-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698