Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (217624 => 217625)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-05-31 20:54:49 UTC (rev 217625)
@@ -1,3 +1,46 @@
+2017-05-31 Devin Rousso <[email protected]>
+
+ Web Inspector: Add Debug view to Settings tab for debug settings and experimental features
+ https://bugs.webkit.org/show_bug.cgi?id=172477
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Base/Setting.js:
+ Add three new settings:
+ - autoLogProtocolMessages
+ - autoLogTimeStats
+ - enableUncaughtExceptionReporter
+
+ * UserInterface/Debug/Bootstrap.js:
+ (WebInspector.runBootstrapOperations):
+ Update toolbar item state when editor in Settings tab is changed.
+
+ * UserInterface/Debug/UncaughtExceptionReporter.js:
+ (handleUncaughtExceptionRecord):
+ Return if the setting controlling the uncaught exception reporter is disabled.
+
+ * UserInterface/Protocol/InspectorBackend.js:
+ (InspectorBackendClass):
+ (InspectorBackendClass.prototype.set dumpInspectorProtocolMessages):
+ (InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
+ (InspectorBackendClass.prototype.set dumpInspectorTimeStats):
+ (InspectorBackendClass.prototype.get dumpInspectorTimeStats):
+ Replace member variables and private Setting objects with items on WebInspector.settings.
+
+ * UserInterface/Main.html:
+ * UserInterface/Views/GeneralSettingsView.js: Removed.
+ Consolidated into SettingsTabContentView.
+
+ * UserInterface/Views/SettingsTabContentView.js:
+ (WebInspector.SettingsTabContentView):
+ (WebInspector.SettingsTabContentView.prototype.initialLayout):
+ (WebInspector.SettingsTabContentView.prototype._createGeneralSettingsView):
+ (WebInspector.SettingsTabContentView.prototype._createDebugSettingsView):
+ (WebInspector.SettingsTabContentView.prototype._updateDebugSettingsViewVisibility):
+
+ * UserInterface/Views/SettingsView.js:
+ (WebInspector.SettingsView.prototype.addGroupWithCustomSetting):
+
2017-05-31 Fujii Hironori <[email protected]>
[GTK] Web Inspector: BackForwardArrows.svg is not shown
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js (217624 => 217625)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js 2017-05-31 20:54:49 UTC (rev 217625)
@@ -103,6 +103,9 @@
};
WebInspector.settings = {
+ autoLogProtocolMessages: new WebInspector.Setting("auto-collect-protocol-messages", false),
+ autoLogTimeStats: new WebInspector.Setting("auto-collect-time-stats", false),
+ enableUncaughtExceptionReporter: new WebInspector.Setting("enable-uncaught-exception-reporter", true),
enableLineWrapping: new WebInspector.Setting("enable-line-wrapping", false),
indentUnit: new WebInspector.Setting("indent-unit", 4),
tabSize: new WebInspector.Setting("tab-size", 4),
Modified: trunk/Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js (217624 => 217625)
--- trunk/Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js 2017-05-31 20:54:49 UTC (rev 217625)
@@ -37,8 +37,8 @@
window.location.reload();
});
- let toolTip = "Enable dump inspector messages to console";
- let activatedToolTip = "Disable dump inspector messages to console";
+ const toolTip = WebInspector.unlocalizedString("Enable dump inspector messages to console");
+ const activatedToolTip = WebInspector.unlocalizedString("Disable dump inspector messages to console");
let debugInspectorToolbarButton = new WebInspector.ActivateButtonToolbarItem("debug-inspector", toolTip, activatedToolTip, null, "Images/Console.svg");
debugInspectorToolbarButton.activated = InspectorBackend.dumpInspectorProtocolMessages;
WebInspector.toolbar.addToolbarItem(debugInspectorToolbarButton, WebInspector.Toolbar.Section.CenterRight);
@@ -46,6 +46,9 @@
InspectorBackend.dumpInspectorProtocolMessages = !InspectorBackend.dumpInspectorProtocolMessages;
debugInspectorToolbarButton.activated = InspectorBackend.dumpInspectorProtocolMessages;
});
+ WebInspector.settings.autoLogProtocolMessages.addEventListener(WebInspector.Setting.Event.Changed, () => {
+ debugInspectorToolbarButton.activated = InspectorBackend.dumpInspectorProtocolMessages;
+ });
function updateDebugUI()
{
Modified: trunk/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js (217624 => 217625)
--- trunk/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js 2017-05-31 20:54:49 UTC (rev 217625)
@@ -72,6 +72,9 @@
}
function handleUncaughtExceptionRecord(exceptionRecord) {
+ if (!WebInspector.settings.enableUncaughtExceptionReporter.value)
+ return;
+
if (!window.__uncaughtExceptions)
window.__uncaughtExceptions = [];
Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (217624 => 217625)
--- trunk/Source/WebInspectorUI/UserInterface/Main.html 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html 2017-05-31 20:54:49 UTC (rev 217625)
@@ -490,8 +490,6 @@
<script src=""
<script src=""
- <script src=""
-
<script src=""
<script src=""
<script src=""
Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js (217624 => 217625)
--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js 2017-05-31 20:54:49 UTC (rev 217625)
@@ -40,11 +40,10 @@
this._defaultTracer = new WebInspector.LoggingProtocolTracer;
this._activeTracers = [this._defaultTracer];
- this._dumpInspectorTimeStats = false;
this._workerSupportedDomains = [];
- let setting = WebInspector.autoLogProtocolMessagesSetting = new WebInspector.Setting("auto-collect-protocol-messages", false);
- setting.addEventListener(WebInspector.Setting.Event.Changed, this._startOrStopAutomaticTracing.bind(this));
+ WebInspector.settings.autoLogProtocolMessages.addEventListener(WebInspector.Setting.Event.Changed, this._startOrStopAutomaticTracing, this);
+ WebInspector.settings.autoLogTimeStats.addEventListener(WebInspector.Setting.Event.Changed, this._startOrStopAutomaticTracing, this);
this._startOrStopAutomaticTracing();
this.currentDispatchState = {
@@ -64,8 +63,7 @@
set dumpInspectorProtocolMessages(value)
{
// Implicitly cause automatic logging to start if it's allowed.
- let setting = WebInspector.autoLogProtocolMessagesSetting;
- setting.value = value;
+ WebInspector.settings.autoLogProtocolMessages.value = value;
this._defaultTracer.dumpMessagesToConsole = value;
}
@@ -72,12 +70,12 @@
get dumpInspectorProtocolMessages()
{
- return WebInspector.autoLogProtocolMessagesSetting.value;
+ return WebInspector.settings.autoLogProtocolMessages.value;
}
set dumpInspectorTimeStats(value)
{
- this._dumpInspectorTimeStats = !!value;
+ WebInspector.settings.autoLogTimeStats.value = value;
if (!this.dumpInspectorProtocolMessages)
this.dumpInspectorProtocolMessages = true;
@@ -87,7 +85,7 @@
get dumpInspectorTimeStats()
{
- return this._dumpInspectorTimeStats;
+ return WebInspector.settings.autoLogTimeStats.value;
}
set customTracer(tracer)
Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/GeneralSettingsView.js (217624 => 217625)
--- trunk/Source/WebInspectorUI/UserInterface/Views/GeneralSettingsView.js 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GeneralSettingsView.js 2017-05-31 20:54:49 UTC (rev 217625)
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.GeneralSettingsView = class GeneralSettingsView extends WebInspector.SettingsView
-{
- constructor()
- {
- super("general", WebInspector.UIString("General"));
- }
-
- // Protected
-
- initialLayout()
- {
- const indentValues = [WebInspector.UIString("Tabs"), WebInspector.UIString("Spaces")];
-
- let [/* unused */, indentEditor] = this.addGroupWithCustomSetting(WebInspector.UIString("Prefer indent using:"), WebInspector.SettingEditor.Type.Select, {values: indentValues});
- indentEditor.value = indentValues[WebInspector.settings.indentWithTabs.value ? 0 : 1];
- indentEditor.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange, () => {
- WebInspector.settings.indentWithTabs.value = indentEditor.value === indentValues[0];
- });
-
- const widthLabel = WebInspector.UIString("spaces");
- const widthOptions = {min: 1};
-
- this.addSetting(WebInspector.UIString("Tab width:"), WebInspector.settings.tabSize, widthLabel, widthOptions);
- this.addSetting(WebInspector.UIString("Indent width:"), WebInspector.settings.indentUnit, widthLabel, widthOptions);
-
- this.addSetting(WebInspector.UIString("Line wrapping:"), WebInspector.settings.enableLineWrapping, WebInspector.UIString("Wrap lines to editor width"));
-
- let showGroup = this.addGroup(WebInspector.UIString("Show:"));
- showGroup.addSetting(WebInspector.settings.showWhitespaceCharacters, WebInspector.UIString("Whitespace characters"));
- showGroup.addSetting(WebInspector.settings.showInvalidCharacters, WebInspector.UIString("Invalid characters"));
-
- this.addSeparator();
-
- let stylesEditingGroup = this.addGroup(WebInspector.UIString("Styles Editing:"));
- stylesEditingGroup.addSetting(WebInspector.settings.stylesShowInlineWarnings, WebInspector.UIString("Show inline warnings"));
- stylesEditingGroup.addSetting(WebInspector.settings.stylesInsertNewline, WebInspector.UIString("Automatically insert newline"));
- stylesEditingGroup.addSetting(WebInspector.settings.stylesSelectOnFirstClick, WebInspector.UIString("Select text on first click"));
-
- this.addSeparator();
-
- this.addSetting(WebInspector.UIString("Network:"), WebInspector.settings.clearNetworkOnNavigate, WebInspector.UIString("Clear when page navigates"));
-
- this.addSeparator();
-
- this.addSetting(WebInspector.UIString("Console:"), WebInspector.settings.clearLogOnNavigate, WebInspector.UIString("Clear when page navigates"));
-
- this.addSeparator();
-
- this.addSetting(WebInspector.UIString("Debugger:"), WebInspector.settings.showScopeChainOnPause, WebInspector.UIString("Show Scope Chain on pause"));
-
- this.addSeparator();
-
- const zoomLevels = [0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4];
- const zoomValues = zoomLevels.map((level) => [level, Number.percentageString(level, 0)]);
-
- let [/* unused */, zoomEditor] = this.addGroupWithCustomSetting(WebInspector.UIString("Zoom:"), WebInspector.SettingEditor.Type.Select, {values: zoomValues});
- zoomEditor.value = WebInspector.getZoomFactor();
- zoomEditor.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange, () => { WebInspector.setZoomFactor(zoomEditor.value); });
- WebInspector.settings.zoomFactor.addEventListener(WebInspector.Setting.Event.Changed, () => { zoomEditor.value = WebInspector.getZoomFactor().maxDecimals(2); });
-
- this.addSeparator();
-
- // This setting is only ever shown in engineering builds, so its strings are unlocalized.
- const layoutDirectionValues = [
- [WebInspector.LayoutDirection.System, WebInspector.unlocalizedString("System Default")],
- [WebInspector.LayoutDirection.LTR, WebInspector.unlocalizedString("Left to Right (LTR)")],
- [WebInspector.LayoutDirection.RTL, WebInspector.unlocalizedString("Right to Left (RTL)")],
- ];
-
- let [layoutDirectionGroup, layoutDirectionEditor] = this.addGroupWithCustomSetting(WebInspector.unlocalizedString("Layout Direction:"), WebInspector.SettingEditor.Type.Select, {values: layoutDirectionValues});
- this._layoutDirectionGroup = layoutDirectionGroup;
- layoutDirectionEditor.value = WebInspector.settings.layoutDirection.value;
- layoutDirectionEditor.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange, () => { WebInspector.setLayoutDirection(layoutDirectionEditor.value); });
- }
-
- layout()
- {
- this._layoutDirectionGroup.element.classList.toggle("hidden", !WebInspector.isDebugUIEnabled());
- }
-};
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js (217624 => 217625)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js 2017-05-31 20:54:49 UTC (rev 217625)
@@ -158,19 +158,110 @@
{
this._navigationBar = new WebInspector.NavigationBar;
this._navigationBar.addEventListener(WebInspector.NavigationBar.Event.NavigationItemSelected, this._navigationItemSelected, this);
-
this.addSubview(this._navigationBar);
- let generalSettingsView = new WebInspector.GeneralSettingsView;
+ this._createGeneralSettingsView();
+
+ WebInspector.notifications.addEventListener(WebInspector.Notification.DebugUIEnabledDidChange, this._updateDebugSettingsViewVisibility, this);
+ this._updateDebugSettingsViewVisibility();
+ }
+
+ // Private
+
+ _createGeneralSettingsView()
+ {
+ let generalSettingsView = new WebInspector.SettingsView("general", WebInspector.UIString("General"));
+
+ const indentValues = [WebInspector.UIString("Tabs"), WebInspector.UIString("Spaces")];
+
+ let indentEditor = generalSettingsView.addGroupWithCustomSetting(WebInspector.UIString("Prefer indent using:"), WebInspector.SettingEditor.Type.Select, {values: indentValues});
+ indentEditor.value = indentValues[WebInspector.settings.indentWithTabs.value ? 0 : 1];
+ indentEditor.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange, () => {
+ WebInspector.settings.indentWithTabs.value = indentEditor.value === indentValues[0];
+ });
+
+ const widthLabel = WebInspector.UIString("spaces");
+ const widthOptions = {min: 1};
+
+ generalSettingsView.addSetting(WebInspector.UIString("Tab width:"), WebInspector.settings.tabSize, widthLabel, widthOptions);
+ generalSettingsView.addSetting(WebInspector.UIString("Indent width:"), WebInspector.settings.indentUnit, widthLabel, widthOptions);
+
+ generalSettingsView.addSetting(WebInspector.UIString("Line wrapping:"), WebInspector.settings.enableLineWrapping, WebInspector.UIString("Wrap lines to editor width"));
+
+ let showGroup = generalSettingsView.addGroup(WebInspector.UIString("Show:"));
+ showGroup.addSetting(WebInspector.settings.showWhitespaceCharacters, WebInspector.UIString("Whitespace characters"));
+ showGroup.addSetting(WebInspector.settings.showInvalidCharacters, WebInspector.UIString("Invalid characters"));
+
+ generalSettingsView.addSeparator();
+
+ let stylesEditingGroup = generalSettingsView.addGroup(WebInspector.UIString("Styles Editing:"));
+ stylesEditingGroup.addSetting(WebInspector.settings.stylesShowInlineWarnings, WebInspector.UIString("Show inline warnings"));
+ stylesEditingGroup.addSetting(WebInspector.settings.stylesInsertNewline, WebInspector.UIString("Automatically insert newline"));
+ stylesEditingGroup.addSetting(WebInspector.settings.stylesSelectOnFirstClick, WebInspector.UIString("Select text on first click"));
+
+ generalSettingsView.addSeparator();
+
+ generalSettingsView.addSetting(WebInspector.UIString("Network:"), WebInspector.settings.clearNetworkOnNavigate, WebInspector.UIString("Clear when page navigates"));
+
+ generalSettingsView.addSeparator();
+
+ generalSettingsView.addSetting(WebInspector.UIString("Console:"), WebInspector.settings.clearLogOnNavigate, WebInspector.UIString("Clear when page navigates"));
+
+ generalSettingsView.addSeparator();
+
+ generalSettingsView.addSetting(WebInspector.UIString("Debugger:"), WebInspector.settings.showScopeChainOnPause, WebInspector.UIString("Show Scope Chain on pause"));
+
+ generalSettingsView.addSeparator();
+
+ const zoomLevels = [0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4];
+ const zoomValues = zoomLevels.map((level) => [level, Number.percentageString(level, 0)]);
+
+ let zoomEditor = generalSettingsView.addGroupWithCustomSetting(WebInspector.UIString("Zoom:"), WebInspector.SettingEditor.Type.Select, {values: zoomValues});
+ zoomEditor.value = WebInspector.getZoomFactor();
+ zoomEditor.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange, () => { WebInspector.setZoomFactor(zoomEditor.value); });
+ WebInspector.settings.zoomFactor.addEventListener(WebInspector.Setting.Event.Changed, () => { zoomEditor.value = WebInspector.getZoomFactor().maxDecimals(2); });
+
this.addSettingsView(generalSettingsView);
-
this.selectedSettingsView = generalSettingsView;
+ }
- WebInspector.notifications.addEventListener(WebInspector.Notification.DebugUIEnabledDidChange, this.needsLayout.bind(this, WebInspector.View.LayoutReason.Dirty));
+ _createDebugSettingsView()
+ {
+ if (this._debugSettingsView)
+ return;
+
+ // These settings are only ever shown in engineering builds, so the strings are unlocalized.
+
+ this._debugSettingsView = new WebInspector.SettingsView("debug", WebInspector.unlocalizedString("Debug"));
+
+ let protocolMessagesGroup = this._debugSettingsView.addGroup(WebInspector.unlocalizedString("Protocol Logging:"));
+
+ let autoLogProtocolMessagesEditor = protocolMessagesGroup.addSetting(WebInspector.settings.autoLogProtocolMessages, WebInspector.unlocalizedString("Messages"));
+ WebInspector.settings.autoLogProtocolMessages.addEventListener(WebInspector.Setting.Event.Changed, () => {
+ autoLogProtocolMessagesEditor.value = InspectorBackend.dumpInspectorProtocolMessages;
+ });
+
+ protocolMessagesGroup.addSetting(WebInspector.settings.autoLogTimeStats, WebInspector.unlocalizedString("Time Stats"));
+
+ this._debugSettingsView.addSeparator();
+
+ this._debugSettingsView.addSetting(WebInspector.unlocalizedString("Uncaught Exception Reporter:"), WebInspector.settings.enableUncaughtExceptionReporter, WebInspector.unlocalizedString("Enabled"));
+
+ this._debugSettingsView.addSeparator();
+
+ const layoutDirectionValues = [
+ [WebInspector.LayoutDirection.System, WebInspector.unlocalizedString("System Default")],
+ [WebInspector.LayoutDirection.LTR, WebInspector.unlocalizedString("Left to Right (LTR)")],
+ [WebInspector.LayoutDirection.RTL, WebInspector.unlocalizedString("Right to Left (RTL)")],
+ ];
+
+ let layoutDirectionEditor = this._debugSettingsView.addGroupWithCustomSetting(WebInspector.unlocalizedString("Layout Direction:"), WebInspector.SettingEditor.Type.Select, {values: layoutDirectionValues});
+ layoutDirectionEditor.value = WebInspector.settings.layoutDirection.value;
+ layoutDirectionEditor.addEventListener(WebInspector.SettingEditor.Event.ValueDidChange, () => { WebInspector.setLayoutDirection(layoutDirectionEditor.value); });
+
+ this.addSettingsView(this._debugSettingsView);
}
- // Private
-
_updateNavigationBarVisibility()
{
let visibleItems = 0;
@@ -197,6 +288,20 @@
this.selectedSettingsView = settingsView;
}
+
+ _updateDebugSettingsViewVisibility()
+ {
+ // Only create the Debug view if the debug UI is enabled.
+ if (WebInspector.isDebugUIEnabled())
+ this._createDebugSettingsView();
+
+ if (!this._debugSettingsView)
+ return;
+
+ this.setSettingsViewVisible(this._debugSettingsView, WebInspector.isDebugUIEnabled());
+
+ this.needsLayout();
+ }
};
WebInspector.SettingsTabContentView.Type = "settings";
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SettingsView.js (217624 => 217625)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SettingsView.js 2017-05-31 20:51:12 UTC (rev 217624)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SettingsView.js 2017-05-31 20:54:49 UTC (rev 217625)
@@ -49,8 +49,7 @@
addGroupWithCustomSetting(title, editorType, options)
{
let settingsGroup = this.addGroup(title);
- let customSetting = settingsGroup.addCustomSetting(editorType, options);
- return [settingsGroup, customSetting];
+ return settingsGroup.addCustomSetting(editorType, options);
}
addGroup(title)