Diff
Modified: trunk/LayoutTests/ChangeLog (115444 => 115445)
--- trunk/LayoutTests/ChangeLog 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/LayoutTests/ChangeLog 2012-04-27 16:53:01 UTC (rev 115445)
@@ -1,5 +1,16 @@
2012-04-27 Dimitri Glazkov <[email protected]>
+ Unreviewed, rolling out r115417.
+ http://trac.webkit.org/changeset/115417
+ https://bugs.webkit.org/show_bug.cgi?id=84946
+
+ Added test is broken on windows.
+
+ * inspector/debugger/disable-script-expected.txt: Removed.
+ * inspector/debugger/disable-script.html: Removed.
+
+2012-04-27 Dimitri Glazkov <[email protected]>
+
[Chromium] fast/images/gif-large-checkerboard.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=85073
Deleted: trunk/LayoutTests/inspector/debugger/disable-script-expected.txt (115444 => 115445)
--- trunk/LayoutTests/inspector/debugger/disable-script-expected.txt 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/LayoutTests/inspector/debugger/disable-script-expected.txt 2012-04-27 16:53:01 UTC (rev 115445)
@@ -1,21 +0,0 @@
-Tests that inspector effectively disables script execution in the inspected page.
-
-Execution count: 2
-
-Running: init
-Script execution status: allowed
-
-Running: tryWithEnabled
-Attempting execution...
-Script execution status: allowed
-
-Running: tryWithDisabled
-Attempting execution...
-Script execution status: disabled
-
-Running: tryWithRestored
-Attempting execution...
-Script execution status: allowed
-
-Running: finalize
-
Deleted: trunk/LayoutTests/inspector/debugger/disable-script.html (115444 => 115445)
--- trunk/LayoutTests/inspector/debugger/disable-script.html 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/LayoutTests/inspector/debugger/disable-script.html 2012-04-27 16:53:01 UTC (rev 115445)
@@ -1,85 +0,0 @@
-<html>
-<head>
-<script src=""
-<script>
-var count = 0;
-
-function updateCount()
-{
- setTimeout(function() {
- count++;
- }, 0);
-}
-
-function recordExecutions()
-{
- document.getElementById("main").textContent = "Execution count: " + count;
-}
-
-function test()
-{
- function dumpState(next)
- {
- PageAgent.getScriptExecutionStatus(statusCallback);
- function statusCallback(error, status)
- {
- if (error) {
- InspectorTest.addResult("Error: " + JSON.stringify(error));
- return;
- }
-
- InspectorTest.addResult("Script execution status: " + status);
- next();
- }
- }
-
- function updateCount(next)
- {
- InspectorTest.addResult("Attempting execution...");
- InspectorTest.evaluateInPage("updateCount()", next);
- }
-
- function setJSDisabled(disabled, next)
- {
- PageAgent.setScriptExecutionDisabled(disabled, next);
- }
-
- InspectorTest.runTestSuite([
- function init(next)
- {
- PageAgent.enable();
- dumpState(next);
- },
-
- function tryWithEnabled(next)
- {
- updateCount(dumpState.bind(null, next));
- },
-
- function tryWithDisabled(next)
- {
- setJSDisabled(true, updateCount.bind(null, dumpState.bind(null, next)));
- },
-
- function tryWithRestored(next)
- {
- setJSDisabled(false, updateCount.bind(null, dumpState.bind(null, next)));
- },
-
- function finalize(next)
- {
- InspectorTest.evaluateInPage("recordExecutions()", next);
- }
- ]);
-}
-</script>
-</head>
-
-<body _onload_="runTest()">
-<p>
-Tests that inspector effectively disables script execution in the inspected page.
-</p>
-
-<div id="main">Original text.</div>
-</body>
-</html>
Modified: trunk/Source/WebCore/ChangeLog (115444 => 115445)
--- trunk/Source/WebCore/ChangeLog 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/Source/WebCore/ChangeLog 2012-04-27 16:53:01 UTC (rev 115445)
@@ -1,3 +1,21 @@
+2012-04-27 Dimitri Glazkov <[email protected]>
+
+ Unreviewed, rolling out r115417.
+ http://trac.webkit.org/changeset/115417
+ https://bugs.webkit.org/show_bug.cgi?id=84946
+
+ Added test is broken on windows.
+
+ * inspector/Inspector.json:
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::enable):
+ (WebCore::InspectorPageAgent::disable):
+ * inspector/InspectorPageAgent.h:
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/SettingsScreen.js:
+ (WebInspector.SettingsScreen):
+ * inspector/front-end/inspector.js:
+
2012-04-27 Gavin Peters <[email protected]>
Add new ENABLE_LINK_PRERENDER define to control the Prerendering API
Modified: trunk/Source/WebCore/inspector/Inspector.json (115444 => 115445)
--- trunk/Source/WebCore/inspector/Inspector.json 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/Source/WebCore/inspector/Inspector.json 2012-04-27 16:53:01 UTC (rev 115445)
@@ -335,20 +335,6 @@
{ "name": "result", "type": "boolean", "description": "True for showing paint rectangles" }
],
"hidden": true
- },
- {
- "name": "getScriptExecutionStatus",
- "description": "Determines if scripts can be executed in the page.",
- "returns": [
- { "name": "result", "type": "string", "enum": ["allowed", "disabled", "forbidden"], "description": "Script execution status: \"allowed\" if scripts can be executed, \"disabled\" if script execution has been disabled through page settings, \"forbidden\" if script execution for the given page is not possible for other reasons." }
- ]
- },
- {
- "name": "setScriptExecutionDisabled",
- "description": "Switches script execution in the page.",
- "parameters": [
- { "name": "value", "type": "boolean", "description": "Whether script execution should be disabled in the page." }
- ]
}
],
"events": [
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (115444 => 115445)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2012-04-27 16:53:01 UTC (rev 115445)
@@ -66,7 +66,6 @@
#include "RegularExpression.h"
#include "ScriptObject.h"
#include "SecurityOrigin.h"
-#include "Settings.h"
#include "SharedBuffer.h"
#include "TextEncoding.h"
#include "TextResourceDecoder.h"
@@ -82,7 +81,6 @@
namespace PageAgentState {
static const char pageAgentEnabled[] = "pageAgentEnabled";
-static const char pageAgentScriptExecutionDisabled[] = "pageAgentScriptExecutionDisabled";
static const char pageAgentScriptsToEvaluateOnLoad[] = "pageAgentScriptsToEvaluateOnLoad";
static const char pageAgentScreenWidthOverride[] = "pageAgentScreenWidthOverride";
static const char pageAgentScreenHeightOverride[] = "pageAgentScreenHeightOverride";
@@ -349,8 +347,6 @@
void InspectorPageAgent::enable(ErrorString*)
{
m_state->setBoolean(PageAgentState::pageAgentEnabled, true);
- bool scriptExecutionDisabled = m_state->getBoolean(PageAgentState::pageAgentScriptExecutionDisabled);
- setScriptExecutionDisabled(0, scriptExecutionDisabled);
m_instrumentingAgents->setInspectorPageAgent(this);
}
@@ -359,8 +355,6 @@
m_state->setBoolean(PageAgentState::pageAgentEnabled, false);
m_instrumentingAgents->setInspectorPageAgent(0);
- setScriptExecutionDisabled(0, false);
-
// When disabling the agent, reset the override values.
m_state->setLong(PageAgentState::pageAgentScreenWidthOverride, 0);
m_state->setLong(PageAgentState::pageAgentScreenHeightOverride, 0);
@@ -694,39 +688,6 @@
m_page->mainFrame()->view()->invalidate();
}
-void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, PageCommandHandler::Result::Enum* status)
-{
- bool disabledByScriptController = false;
- bool disabledInSettings = false;
- Frame* frame = mainFrame();
- if (frame) {
- disabledByScriptController = !frame->script()->canExecuteScripts(NotAboutToExecuteScript);
- if (frame->settings())
- disabledInSettings = !frame->settings()->isScriptEnabled();
- }
-
- if (!disabledByScriptController) {
- *status = PageCommandHandler::Result::Allowed;
- return;
- }
-
- if (disabledInSettings)
- *status = PageCommandHandler::Result::Disabled;
- else
- *status = PageCommandHandler::Result::Forbidden;
-}
-
-void InspectorPageAgent::setScriptExecutionDisabled(ErrorString*, bool value)
-{
- m_state->setBoolean(PageAgentState::pageAgentScriptExecutionDisabled, value);
- if (!mainFrame())
- return;
-
- Settings* settings = mainFrame()->settings();
- if (settings)
- settings->setScriptEnabled(!value);
-}
-
void InspectorPageAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
{
if (world != mainThreadNormalWorld())
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (115444 => 115445)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.h 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h 2012-04-27 16:53:01 UTC (rev 115445)
@@ -105,8 +105,6 @@
virtual void canOverrideDeviceMetrics(ErrorString*, bool*);
virtual void setDeviceMetricsOverride(ErrorString*, int width, int height, double fontScaleFactor, bool fitWindow);
virtual void setShowPaintRects(ErrorString*, bool show);
- virtual void getScriptExecutionStatus(ErrorString*, PageCommandHandler::Result::Enum*);
- virtual void setScriptExecutionDisabled(ErrorString*, bool);
// InspectorInstrumentation API
void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
Modified: trunk/Source/WebCore/inspector/front-end/Settings.js (115444 => 115445)
--- trunk/Source/WebCore/inspector/front-end/Settings.js 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/Source/WebCore/inspector/front-end/Settings.js 2012-04-27 16:53:01 UTC (rev 115445)
@@ -95,7 +95,6 @@
this.showPaintRects = this.createSetting("showPaintRects", false);
this.zoomLevel = this.createSetting("zoomLevel", 0);
this.savedURLs = this.createSetting("savedURLs", {});
- this._javascript_Disabled = this.createSetting("_javascript_Disabled", false);
// If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
// periodical breakpoints duplication leading to inspector slowness.
Modified: trunk/Source/WebCore/inspector/front-end/SettingsScreen.js (115444 => 115445)
--- trunk/Source/WebCore/inspector/front-end/SettingsScreen.js 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/Source/WebCore/inspector/front-end/SettingsScreen.js 2012-04-27 16:53:01 UTC (rev 115445)
@@ -38,16 +38,15 @@
this._leftColumnElement = document.createElement("td");
this._rightColumnElement = document.createElement("td");
- var p = this._appendSection(WebInspector.UIString("General"));
- if (Preferences.showDockToRight)
- p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Dock to right"), WebInspector.settings.dockToRight));
- if (Preferences.exposeDisableCache)
- p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Disable cache"), WebInspector.settings.cacheDisabled));
- var disableJSElement = this._createCheckboxSetting(WebInspector.UIString("Disable _javascript_"), WebInspector.settings._javascript_Disabled);
- p.appendChild(disableJSElement);
- WebInspector.settings._javascript_Disabled.addChangeListener(this._javaScriptDisabledChanged, this);
- this._disableJSCheckbox = disableJSElement.getElementsByTagName("input")[0];
- this._updateScriptDisabledCheckbox();
+ var p;
+
+ if (Preferences.showDockToRight || Preferences.exposeDisableCache) {
+ p = this._appendSection(WebInspector.UIString("General"));
+ if (Preferences.showDockToRight)
+ p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Dock to right"), WebInspector.settings.dockToRight));
+ if (Preferences.exposeDisableCache)
+ p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Disable cache"), WebInspector.settings.cacheDisabled));
+ }
p = this._appendSection(WebInspector.UIString("Rendering"));
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show paint rectangles"), WebInspector.settings.showPaintRects));
@@ -409,36 +408,6 @@
PageAgent.setShowPaintRects(WebInspector.settings.showPaintRects.get());
},
- _updateScriptDisabledCheckbox: function()
- {
- function executionStatusCallback(error, status)
- {
- if (error || !status)
- return;
-
- switch (status) {
- case "forbidden":
- this._disableJSCheckbox.checked = true;
- this._disableJSCheckbox.disabled = true;
- break;
- case "disabled":
- this._disableJSCheckbox.checked = true;
- break;
- default:
- this._disableJSCheckbox.checked = false;
- break;
- }
- }
-
- PageAgent.getScriptExecutionStatus(executionStatusCallback.bind(this));
- },
-
- _javaScriptDisabledChanged: function()
- {
- // We need to manually update the checkbox state, since enabling _javascript_ in the page can actually uncover the "forbidden" state.
- PageAgent.setScriptExecutionDisabled(WebInspector.settings._javascript_Disabled.get(), this._updateScriptDisabledCheckbox.bind(this));
- },
-
_createDeviceMetricsControl: function()
{
const metricsSetting = WebInspector.settings.deviceMetrics.get();
Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (115444 => 115445)
--- trunk/Source/WebCore/inspector/front-end/inspector.js 2012-04-27 16:46:55 UTC (rev 115444)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js 2012-04-27 16:53:01 UTC (rev 115445)
@@ -481,9 +481,6 @@
if (WebInspector.settings.showPaintRects.get())
PageAgent.setShowPaintRects(true);
- if (WebInspector.settings._javascript_Disabled.get())
- PageAgent.setScriptExecutionDisabled(true);
-
WebInspector.WorkerManager.loadCompleted();
InspectorFrontendAPI.loadCompleted();
}