[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Thu Apr 8 00:59:22 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit ce7351ee0352f60fa28a9993bbf6103508c8001d
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jan 10 02:36:26 2010 +0000

    2010-01-09  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            ScriptController::isEnabled needs to be renamed
            https://bugs.webkit.org/show_bug.cgi?id=32063
    
            Rename ScriptController::isEnabled to
            ScriptController::canExecuteScripts to reflect what the method actually
            means.  This is a trivial change, but it involved touching a lot of
            call sites.
    
            * WebCore.PluginHostProcess.exp:
            * bindings/ScriptControllerBase.cpp:
            (WebCore::ScriptController::canExecuteScripts):
            (WebCore::ScriptController::executeScript):
            * bindings/js/JSEventListener.cpp:
            (WebCore::JSEventListener::handleEvent):
            * bindings/js/JSLazyEventListener.cpp:
            (WebCore::JSLazyEventListener::parseCode):
            * bindings/js/ScheduledAction.cpp:
            (WebCore::ScheduledAction::execute):
            * bindings/js/ScriptController.cpp:
            (WebCore::ScriptController::bindingRootObject):
            (WebCore::ScriptController::windowScriptNPObject):
            (WebCore::ScriptController::jsObjectForPluginElement):
            (WebCore::ScriptController::executeScriptInWorld):
            * bindings/js/ScriptController.h:
            * bindings/js/ScriptControllerMac.mm:
            (WebCore::ScriptController::windowScriptObject):
            * bindings/js/ScriptEventListener.cpp:
            (WebCore::createAttributeEventListener):
            * bindings/js/ScriptState.cpp:
            (WebCore::scriptStateFromNode):
            * bindings/v8/ScriptController.cpp:
            (WebCore::ScriptController::windowScriptNPObject):
            (WebCore::ScriptController::createScriptObjectForPluginElement):
            * bindings/v8/ScriptController.h:
            * bindings/v8/ScriptEventListener.cpp:
            (WebCore::createAttributeEventListener):
            * bindings/v8/V8Proxy.cpp:
            (WebCore::V8Proxy::retrieve):
            * dom/ScriptElement.cpp:
            (WebCore::ScriptElementData::evaluateScript):
            * dom/XMLTokenizerLibxml2.cpp:
            (WebCore::XMLTokenizer::startElementNs):
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::controls):
            * html/HTMLTokenizer.cpp:
            (WebCore::HTMLTokenizer::parseTag):
            (WebCore::HTMLTokenizer::processToken):
            * inspector/InspectorController.cpp:
            (WebCore::canPassNodeToJavaScript):
            * inspector/JavaScriptDebugServer.cpp:
            (WebCore::JavaScriptDebugServer::setJavaScriptPaused):
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::isProcessingUserGesture):
            (WebCore::FrameLoader::open):
            (WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds):
            (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
    2010-01-09  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            ScriptController::isEnabled needs to be renamed
            https://bugs.webkit.org/show_bug.cgi?id=32063
    
            Rename ScriptController::isEnabled to
            ScriptController::canExecuteScripts.
    
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::bindToWindowObject):
    2010-01-09  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            ScriptController::isEnabled needs to be renamed
            https://bugs.webkit.org/show_bug.cgi?id=32063
    
            Rename ScriptController::isEnabled to
            ScriptController::canExecuteScripts.
    
            * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
            (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
            (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
    2010-01-09  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            ScriptController::isEnabled needs to be renamed
            https://bugs.webkit.org/show_bug.cgi?id=32063
    
            Rename ScriptController::isEnabled to
            ScriptController::canExecuteScripts.
    
            * WebFrame.cpp:
            (wxWebFrame::RunScript):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index da4ccda..19a3950 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,64 @@
+2010-01-09  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        ScriptController::isEnabled needs to be renamed
+        https://bugs.webkit.org/show_bug.cgi?id=32063
+
+        Rename ScriptController::isEnabled to
+        ScriptController::canExecuteScripts to reflect what the method actually
+        means.  This is a trivial change, but it involved touching a lot of
+        call sites.
+
+        * WebCore.PluginHostProcess.exp:
+        * bindings/ScriptControllerBase.cpp:
+        (WebCore::ScriptController::canExecuteScripts):
+        (WebCore::ScriptController::executeScript):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSLazyEventListener.cpp:
+        (WebCore::JSLazyEventListener::parseCode):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::execute):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::bindingRootObject):
+        (WebCore::ScriptController::windowScriptNPObject):
+        (WebCore::ScriptController::jsObjectForPluginElement):
+        (WebCore::ScriptController::executeScriptInWorld):
+        * bindings/js/ScriptController.h:
+        * bindings/js/ScriptControllerMac.mm:
+        (WebCore::ScriptController::windowScriptObject):
+        * bindings/js/ScriptEventListener.cpp:
+        (WebCore::createAttributeEventListener):
+        * bindings/js/ScriptState.cpp:
+        (WebCore::scriptStateFromNode):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::windowScriptNPObject):
+        (WebCore::ScriptController::createScriptObjectForPluginElement):
+        * bindings/v8/ScriptController.h:
+        * bindings/v8/ScriptEventListener.cpp:
+        (WebCore::createAttributeEventListener):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::retrieve):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::evaluateScript):
+        * dom/XMLTokenizerLibxml2.cpp:
+        (WebCore::XMLTokenizer::startElementNs):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::controls):
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::parseTag):
+        (WebCore::HTMLTokenizer::processToken):
+        * inspector/InspectorController.cpp:
+        (WebCore::canPassNodeToJavaScript):
+        * inspector/JavaScriptDebugServer.cpp:
+        (WebCore::JavaScriptDebugServer::setJavaScriptPaused):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::isProcessingUserGesture):
+        (WebCore::FrameLoader::open):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
+
 2010-01-09  Evan Martin  <evan at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/WebCore.PluginHostProcess.exp b/WebCore/WebCore.PluginHostProcess.exp
index cce951f..4b78966 100644
--- a/WebCore/WebCore.PluginHostProcess.exp
+++ b/WebCore/WebCore.PluginHostProcess.exp
@@ -9,7 +9,7 @@ __ZN7WebCore13IdentifierRep3getEi
 __ZN7WebCore13IdentifierRep3getEPKc
 __ZN7WebCore13IdentifierRep7isValidEPS0_
 __ZN7WebCore16ScriptController16createRootObjectEPv
+__ZN7WebCore16ScriptController17canExecuteScriptsEv
 __ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE
-__ZN7WebCore16ScriptController9isEnabledEv
 __ZN7WebCore6String26fromUTF8WithLatin1FallbackEPKcm
 __ZN7WebCore6String8fromUTF8EPKcm
diff --git a/WebCore/bindings/ScriptControllerBase.cpp b/WebCore/bindings/ScriptControllerBase.cpp
index 72c9f45..f1217e3 100644
--- a/WebCore/bindings/ScriptControllerBase.cpp
+++ b/WebCore/bindings/ScriptControllerBase.cpp
@@ -22,6 +22,7 @@
 #include "ScriptController.h"
 
 #include "Frame.h"
+#include "FrameLoaderClient.h"
 #include "Page.h"
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
@@ -30,6 +31,15 @@
 
 namespace WebCore {
 
+bool ScriptController::canExecuteScripts()
+{
+    if (m_frame->loader()->isSandboxed(SandboxScripts))
+        return false;
+
+    Settings* settings = m_frame->settings();
+    return m_frame->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled());
+}
+
 ScriptValue ScriptController::executeScript(const String& script, bool forceUserGesture)
 {
     return executeScript(ScriptSourceCode(script, forceUserGesture ? KURL() : m_frame->loader()->url()));
@@ -37,7 +47,7 @@ ScriptValue ScriptController::executeScript(const String& script, bool forceUser
 
 ScriptValue ScriptController::executeScript(const ScriptSourceCode& sourceCode)
 {
-    if (!isEnabled() || isPaused())
+    if (!canExecuteScripts() || isPaused())
         return ScriptValue();
 
     bool wasInExecuteScript = m_inExecuteScript;
diff --git a/WebCore/bindings/js/JSEventListener.cpp b/WebCore/bindings/js/JSEventListener.cpp
index 73060f1..d3b5fe1 100644
--- a/WebCore/bindings/js/JSEventListener.cpp
+++ b/WebCore/bindings/js/JSEventListener.cpp
@@ -81,7 +81,7 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
             return;
         // FIXME: Is this check needed for other contexts?
         ScriptController* script = frame->script();
-        if (!script->isEnabled() || script->isPaused())
+        if (!script->canExecuteScripts() || script->isPaused())
             return;
     }
 
diff --git a/WebCore/bindings/js/JSLazyEventListener.cpp b/WebCore/bindings/js/JSLazyEventListener.cpp
index 6d75f4f..b707991 100644
--- a/WebCore/bindings/js/JSLazyEventListener.cpp
+++ b/WebCore/bindings/js/JSLazyEventListener.cpp
@@ -89,7 +89,7 @@ void JSLazyEventListener::parseCode(ScriptExecutionContext* executionContext) co
         return;
 
     ScriptController* scriptController = frame->script();
-    if (!scriptController->isEnabled())
+    if (!scriptController->canExecuteScripts())
         return;
 
     JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(executionContext, m_isolatedWorld.get());
@@ -110,7 +110,7 @@ void JSLazyEventListener::parseCode(ScriptExecutionContext* executionContext) co
             return;
         // FIXME: Is this check needed for non-Document contexts?
         ScriptController* script = frame->script();
-        if (!script->isEnabled() || script->isPaused())
+        if (!script->canExecuteScripts() || script->isPaused())
             return;
     }
 
diff --git a/WebCore/bindings/js/ScheduledAction.cpp b/WebCore/bindings/js/ScheduledAction.cpp
index 3223e53..be90125 100644
--- a/WebCore/bindings/js/ScheduledAction.cpp
+++ b/WebCore/bindings/js/ScheduledAction.cpp
@@ -117,7 +117,7 @@ void ScheduledAction::execute(Document* document)
         return;
 
     RefPtr<Frame> frame = window->impl()->frame();
-    if (!frame || !frame->script()->isEnabled())
+    if (!frame || !frame->script()->canExecuteScripts())
         return;
 
     frame->script()->setProcessingTimerCallback(true);
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 3c440db..6673eac 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -286,12 +286,6 @@ bool ScriptController::anyPageIsProcessingUserGesture() const
     return false;
 }
 
-bool ScriptController::isEnabled()
-{
-    Settings* settings = m_frame->settings();
-    return m_frame->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled() && !m_frame->loader()->isSandboxed(SandboxScripts));
-}
-
 void ScriptController::attachDebugger(JSC::Debugger* debugger)
 {
     // FIXME: Should be able to debug isolated worlds.
@@ -323,7 +317,7 @@ void ScriptController::updateSecurityOrigin()
 
 Bindings::RootObject* ScriptController::bindingRootObject()
 {
-    if (!isEnabled())
+    if (!canExecuteScripts())
         return 0;
 
     if (!m_bindingRootObject) {
@@ -350,7 +344,7 @@ PassRefPtr<Bindings::RootObject> ScriptController::createRootObject(void* native
 NPObject* ScriptController::windowScriptNPObject()
 {
     if (!m_windowScriptNPObject) {
-        if (isEnabled()) {
+        if (canExecuteScripts()) {
             // JavaScript is enabled, so there is a JavaScript window object.
             // Return an NPObject bound to the window object.
             JSC::JSLock lock(SilenceAssertionsOnly);
@@ -383,7 +377,7 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
 JSObject* ScriptController::jsObjectForPluginElement(HTMLPlugInElement* plugin)
 {
     // Can't create JSObjects when JavaScript is disabled
-    if (!isEnabled())
+    if (!canExecuteScripts())
         return 0;
 
     // Create a JSObject bound to this element
@@ -450,7 +444,7 @@ ScriptValue ScriptController::executeScriptInWorld(DOMWrapperWorld* world, const
 {
     ScriptSourceCode sourceCode(script, forceUserGesture ? KURL() : m_frame->loader()->url());
 
-    if (!isEnabled() || isPaused())
+    if (!canExecuteScripts() || isPaused())
         return ScriptValue();
 
     bool wasInExecuteScript = m_inExecuteScript;
diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h
index 8801622..35ec028 100644
--- a/WebCore/bindings/js/ScriptController.h
+++ b/WebCore/bindings/js/ScriptController.h
@@ -110,7 +110,7 @@ public:
     bool processingUserGesture() const;
     bool anyPageIsProcessingUserGesture() const;
 
-    bool isEnabled();
+    bool canExecuteScripts();
 
     void attachDebugger(JSC::Debugger*);
 
diff --git a/WebCore/bindings/js/ScriptControllerMac.mm b/WebCore/bindings/js/ScriptControllerMac.mm
index 21ec0f2..98d302e 100644
--- a/WebCore/bindings/js/ScriptControllerMac.mm
+++ b/WebCore/bindings/js/ScriptControllerMac.mm
@@ -108,7 +108,7 @@ PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widge
 
 WebScriptObject* ScriptController::windowScriptObject()
 {
-    if (!isEnabled())
+    if (!canExecuteScripts())
         return 0;
 
     if (!m_windowScriptObject) {
diff --git a/WebCore/bindings/js/ScriptEventListener.cpp b/WebCore/bindings/js/ScriptEventListener.cpp
index 8399c7a..b9dc00e 100644
--- a/WebCore/bindings/js/ScriptEventListener.cpp
+++ b/WebCore/bindings/js/ScriptEventListener.cpp
@@ -59,7 +59,7 @@ PassRefPtr<JSLazyEventListener> createAttributeEventListener(Node* node, Attribu
     // FIXME: We should be able to provide accurate source information for frameless documents, too (e.g. for importing nodes from XMLHttpRequest.responseXML).
     if (Frame* frame = node->document()->frame()) {
         ScriptController* scriptController = frame->script();
-        if (!scriptController->isEnabled())
+        if (!scriptController->canExecuteScripts())
             return 0;
 
         if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
@@ -83,7 +83,7 @@ PassRefPtr<JSLazyEventListener> createAttributeEventListener(Frame* frame, Attri
     String sourceURL;
     
     ScriptController* scriptController = frame->script();
-    if (!scriptController->isEnabled())
+    if (!scriptController->canExecuteScripts())
         return 0;
 
     if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
diff --git a/WebCore/bindings/js/ScriptState.cpp b/WebCore/bindings/js/ScriptState.cpp
index b9f78ef..7a760ae 100644
--- a/WebCore/bindings/js/ScriptState.cpp
+++ b/WebCore/bindings/js/ScriptState.cpp
@@ -48,7 +48,7 @@ ScriptState* scriptStateFromNode(DOMWrapperWorld* world, Node* node)
     Frame* frame = document->frame();
     if (!frame)
         return 0;
-    if (!frame->script()->isEnabled())
+    if (!frame->script()->canExecuteScripts())
         return 0;
     return frame->script()->globalObject(world)->globalExec();
 }
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 3298cad..8f367c0 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -294,12 +294,6 @@ bool ScriptController::haveInterpreter() const
     return m_proxy->windowShell()->isContextInitialized();
 }
 
-bool ScriptController::isEnabled() const
-{
-    Settings* settings = m_proxy->frame()->settings();
-    return m_proxy->frame()->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled() && !m_frame->loader()->isSandboxed(SandboxScripts));
-}
-
 PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widget)
 {
     ASSERT(widget);
@@ -401,7 +395,7 @@ NPObject* ScriptController::windowScriptNPObject()
     if (m_windowScriptNPObject)
         return m_windowScriptNPObject;
 
-    if (isEnabled()) {
+    if (canExecuteScripts()) {
         // JavaScript is enabled, so there is a JavaScript window object.
         // Return an NPObject bound to the window object.
         m_windowScriptNPObject = createScriptObject(m_frame);
@@ -418,7 +412,7 @@ NPObject* ScriptController::windowScriptNPObject()
 NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement* plugin)
 {
     // Can't create NPObjects when JavaScript is disabled.
-    if (!isEnabled())
+    if (!canExecuteScripts())
         return createNoScriptObject();
 
     v8::HandleScope handleScope;
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index 9ba7d38..5a9105f 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -112,7 +112,7 @@ public:
     // Check if the javascript engine has been initialized.
     bool haveInterpreter() const;
 
-    bool isEnabled() const;
+    bool canExecuteScripts();
 
     // FIXME: void* is a compile hack.
     void attachDebugger(void*);
diff --git a/WebCore/bindings/v8/ScriptEventListener.cpp b/WebCore/bindings/v8/ScriptEventListener.cpp
index 51d53ab..cf2a1ee 100644
--- a/WebCore/bindings/v8/ScriptEventListener.cpp
+++ b/WebCore/bindings/v8/ScriptEventListener.cpp
@@ -52,7 +52,7 @@ PassRefPtr<V8LazyEventListener> createAttributeEventListener(Node* node, Attribu
 
     if (Frame* frame = node->document()->frame()) {
         ScriptController* scriptController = frame->script();
-        if (!scriptController->isEnabled())
+        if (!scriptController->canExecuteScripts())
             return 0;
 
         if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
@@ -81,7 +81,7 @@ PassRefPtr<V8LazyEventListener> createAttributeEventListener(Frame* frame, Attri
     String sourceURL;
 
     ScriptController* scriptController = frame->script();
-    if (!scriptController->isEnabled())
+    if (!scriptController->canExecuteScripts())
         return 0;
 
     if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index fdb2e49..05acb9d 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -547,7 +547,7 @@ V8Proxy* V8Proxy::retrieve(Frame* frame)
 {
     if (!frame)
         return 0;
-    return frame->script()->isEnabled() ? frame->script()->proxy() : 0;
+    return frame->script()->canExecuteScripts() ? frame->script()->proxy() : 0;
 }
 
 V8Proxy* V8Proxy::retrieve(ScriptExecutionContext* context)
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index 83ed2bb..9a80e16 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -177,7 +177,7 @@ void ScriptElementData::evaluateScript(const ScriptSourceCode& sourceCode)
         return;
 
     if (Frame* frame = m_element->document()->frame()) {
-        if (!frame->script()->isEnabled())
+        if (!frame->script()->canExecuteScripts())
             return;
 
         m_evaluated = true;
diff --git a/WebCore/dom/XMLTokenizerLibxml2.cpp b/WebCore/dom/XMLTokenizerLibxml2.cpp
index c0d76b8..21bdfb0 100644
--- a/WebCore/dom/XMLTokenizerLibxml2.cpp
+++ b/WebCore/dom/XMLTokenizerLibxml2.cpp
@@ -783,7 +783,7 @@ void XMLTokenizer::startElementNs(const xmlChar* xmlLocalName, const xmlChar* xm
     }
 
     ScriptController* jsProxy = m_doc->frame() ? m_doc->frame()->script() : 0;
-    if (jsProxy && m_doc->frame()->script()->isEnabled())
+    if (jsProxy && m_doc->frame()->script()->canExecuteScripts())
         jsProxy->setEventHandlerLineNumber(lineNumber());
 
     handleElementAttributes(newElement.get(), libxmlAttributes, nb_attributes, ec);
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index fd83460..65aa943 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -1152,7 +1152,7 @@ bool HTMLMediaElement::controls() const
     Frame* frame = document()->frame();
 
     // always show controls when scripting is disabled
-    if (frame && !frame->script()->isEnabled())
+    if (frame && !frame->script()->canExecuteScripts())
         return true;
 
     return hasAttribute(controlsAttr);
diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp
index dd0eb31..9a1ffd0 100644
--- a/WebCore/html/HTMLTokenizer.cpp
+++ b/WebCore/html/HTMLTokenizer.cpp
@@ -1501,7 +1501,7 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString& src, State state)
                 m_scriptTagSrcAttrValue = String();
                 m_scriptTagCharsetAttrValue = String();
                 if (m_currentToken.attrs && !m_fragment) {
-                    if (m_doc->frame() && m_doc->frame()->script()->isEnabled()) {
+                    if (m_doc->frame() && m_doc->frame()->script()->canExecuteScripts()) {
                         if ((a = m_currentToken.attrs->getAttributeItem(srcAttr)))
                             m_scriptTagSrcAttrValue = m_doc->completeURL(deprecatedParseURL(a->value())).string();
                     }
@@ -1911,7 +1911,7 @@ void HTMLTokenizer::finish()
 PassRefPtr<Node> HTMLTokenizer::processToken()
 {
     ScriptController* scriptController = (!m_fragment && m_doc->frame()) ? m_doc->frame()->script() : 0;
-    if (scriptController && scriptController->isEnabled())
+    if (scriptController && scriptController->canExecuteScripts())
         // FIXME: Why isn't this m_currentScriptTagStartLineNumber?  I suspect this is wrong.
         scriptController->setEventHandlerLineNumber(m_currentTagStartLineNumber + 1); // Script line numbers are 1 based.
     if (m_dest > m_buffer) {
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 5018dd1..c84a415 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -229,7 +229,7 @@ static bool canPassNodeToJavaScript(Node* node)
     if (!node)
         return false;
     Frame* frame = node->document()->frame();
-    return frame && frame->script()->isEnabled();
+    return frame && frame->script()->canExecuteScripts();
 }
 
 void InspectorController::inspect(Node* node)
diff --git a/WebCore/inspector/JavaScriptDebugServer.cpp b/WebCore/inspector/JavaScriptDebugServer.cpp
index e460ae8..c04353c 100644
--- a/WebCore/inspector/JavaScriptDebugServer.cpp
+++ b/WebCore/inspector/JavaScriptDebugServer.cpp
@@ -423,7 +423,7 @@ void JavaScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
 {
     ASSERT_ARG(frame, frame);
 
-    if (!frame->script()->isEnabled())
+    if (!frame->script()->canExecuteScripts())
         return;
 
     frame->script()->setPaused(paused);
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index e457fd9..85de538 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -1452,7 +1452,7 @@ void FrameLoader::provisionalLoadStarted()
 bool FrameLoader::isProcessingUserGesture()
 {
     Frame* frame = m_frame->tree()->top();
-    if (!frame->script()->isEnabled())
+    if (!frame->script()->canExecuteScripts())
         return true; // If JavaScript is disabled, a user gesture must have initiated the navigation.
     return frame->script()->processingUserGesture(); // FIXME: Use pageIsProcessingUserGesture.
 }
@@ -2659,7 +2659,7 @@ void FrameLoader::open(CachedPage& cachedPage)
     closeURL();
     
     // Delete old status bar messages (if it _was_ activated on last URL).
-    if (m_frame->script()->isEnabled()) {
+    if (m_frame->script()->canExecuteScripts()) {
         m_frame->setJSStatusBarText(String());
         m_frame->setJSDefaultStatusBarText(String());
     }
@@ -3878,7 +3878,7 @@ void FrameLoader::dispatchDocumentElementAvailable()
 
 void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
 {
-    if (!m_frame->script()->isEnabled())
+    if (!m_frame->script()->canExecuteScripts())
         return;
 
     Vector<DOMWrapperWorld*> worlds;
@@ -3889,7 +3889,7 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
 
 void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
 {
-    if (!m_frame->script()->isEnabled() || !m_frame->script()->existingWindowShell(world))
+    if (!m_frame->script()->canExecuteScripts() || !m_frame->script()->existingWindowShell(world))
         return;
 
     m_client->dispatchDidClearWindowObjectInWorld(world);
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index c85a641..6200b04 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-09  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        ScriptController::isEnabled needs to be renamed
+        https://bugs.webkit.org/show_bug.cgi?id=32063
+
+        Rename ScriptController::isEnabled to
+        ScriptController::canExecuteScripts.
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::bindToWindowObject):
+
 2010-01-08  Daniel Bates  <dbates at webkit.org>
 
         Reviewed by Adam Barth.
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index cb700ca..293d7ee 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -597,7 +597,7 @@ NPObject* WebFrameImpl::windowObject() const
 void WebFrameImpl::bindToWindowObject(const WebString& name, NPObject* object)
 {
     ASSERT(m_frame);
-    if (!m_frame || !m_frame->script()->isEnabled())
+    if (!m_frame || !m_frame->script()->canExecuteScripts())
         return;
 
     String key = name;
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index d0e4cfb..8bb99d2 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-09  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        ScriptController::isEnabled needs to be renamed
+        https://bugs.webkit.org/show_bug.cgi?id=32063
+
+        Rename ScriptController::isEnabled to
+        ScriptController::canExecuteScripts.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
+        (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
+
 2010-01-07  Daniel Bates  <dbates at rim.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index c3d99ae..12cbc1c 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -696,7 +696,7 @@ bool NetscapePluginInstanceProxy::getWindowNPObject(uint32_t& objectID)
     if (!frame)
         return false;
     
-    if (!frame->script()->isEnabled())
+    if (!frame->script()->canExecuteScripts())
         objectID = 0;
     else
         objectID = idForObject(frame->script()->windowShell(pluginWorld())->window());
@@ -1201,7 +1201,7 @@ bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArr
             if (!frame)
                 return false;
             
-            if (!frame->script()->isEnabled())
+            if (!frame->script()->canExecuteScripts())
                 return false;
 
             RefPtr<RootObject> rootObject = frame->script()->createRootObject(m_pluginView);
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index 0ce8153..9deb28a 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-09  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        ScriptController::isEnabled needs to be renamed
+        https://bugs.webkit.org/show_bug.cgi?id=32063
+
+        Rename ScriptController::isEnabled to
+        ScriptController::canExecuteScripts.
+
+        * WebFrame.cpp:
+        (wxWebFrame::RunScript):
+
 2009-12-30  Kevin Watters  <kevinwatters at gmail.com>
 
         Reviewed by Kevin Ollivier.
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index d9bb223..8e58e8d 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -194,7 +194,7 @@ wxString wxWebFrame::RunScript(const wxString& javascript)
         wxASSERT_MSG(hasLoaded, wxT("Document must be loaded before calling RunScript."));
         if (hasLoaded) {
             WebCore::ScriptController* controller = m_impl->frame->script();
-            bool jsEnabled = controller->isEnabled(); 
+            bool jsEnabled = controller->canExecuteScripts(); 
             wxASSERT_MSG(jsEnabled, wxT("RunScript requires JavaScript to be enabled."));
             if (jsEnabled) {
                 JSC::JSValue result = controller->executeScript(javascript, true).jsValue();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list