Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Chromium API] Disambiguate allowJavaScript from didNotAllowScript
https://bugs.webkit.org/show_bug.cgi?id=35205 Patch by Adam Barth <abarth@webkit.org> on 2010-02-24 Reviewed by Darin Fisher. WebCore: For clients that want to show a user interface element when JavaScript was blocked on a page, we need to disambiguate between querying the client for whether JavaScript is enabled from actually failing to execute some script. This patch adds a new FrameLoaderClient callback for when WebCore would like to execute JavaScript but fails to because JavaScript is disabled. This patch also touches every client of canExecuteScripts so they can indicate whether we should make this callback. I was hoping there was a better choke point, but my first two attempts were wrong in subtle ways. pkasting points out that this will be easy to screw up in the future, so it's better to make all the clients be explicit. * 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::initializeJSFunction): * 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: (WebCore::): * bindings/js/ScriptControllerMac.mm: (WebCore::ScriptController::windowScriptObject): * bindings/js/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::setJavaScriptPaused): * 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: (WebCore::): * 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): * loader/FrameLoader.cpp: (WebCore::FrameLoader::isProcessingUserGesture): (WebCore::FrameLoader::open): (WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds): (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld): * loader/FrameLoaderClient.h: (WebCore::FrameLoaderClient::didNotAllowScript): WebKit/chromium: Plumb didNotAllowScript through Chromium's WebKit API. * public/WebFrameClient.h: (WebKit::WebFrameClient::didNotAllowScript): * src/DebuggerAgentImpl.cpp: (WebKit::DebuggerAgentImpl::createUtilityContext): * src/FrameLoaderClientImpl.cpp: (WebKit::FrameLoaderClientImpl::didNotAllowScript): * src/FrameLoaderClientImpl.h: * src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::bindToWindowObject): WebKit/mac: Make these two callsites explicit about not running script immediately. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::getWindowNPObject): (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): Canonical link: https://commits.webkit.org/46509@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
31 changed files
with
174 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.