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

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

Issue 313173012: HTMLParser should use current value of scriptEnabled flag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@WebKit-ADD
Patch Set: Created 6 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 | « Source/core/dom/Document.h ('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 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);
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698