Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 7830cc110eecc51a5c9cee56358d17d9339150f4..a0cfdf16fab79a278fd5c2f980d03b2e8b975cb2 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -456,6 +456,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC |
, m_loadEventProgress(LoadEventNotRun) |
, m_startTime(currentTime()) |
, m_scriptRunner(ScriptRunner::create(this)) |
+ , m_scriptEnabled(Uninitialized) |
, m_xmlVersion("1.0") |
, m_xmlStandalone(StandaloneUnspecified) |
, m_hasXMLDeclaration(0) |
@@ -4873,6 +4874,13 @@ bool Document::allowExecutingScripts(Node* node) |
return true; |
} |
+bool Document::scriptEnabled() |
+{ |
+ if (m_scriptEnabled == Uninitialized) |
+ m_scriptEnabled = m_frame->loader().client()->allowScript(settings() && settings()->scriptEnabled()) ? Enabled : Disabled; |
+ return m_scriptEnabled == Enabled; |
+} |
+ |
void Document::updateSecurityOrigin(PassRefPtr<SecurityOrigin> origin) |
{ |
setSecurityOrigin(origin); |