Web Inspector: Move a few remaining global WI settings to WI.settings
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2018 00:37:37 +0000 (00:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2018 00:37:37 +0000 (00:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191137

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-10-31
Reviewed by Brian Burg.

Move and better name some of the WI.settings created in Main.js
to WI.settings, alongside other global settings.

* UserInterface/Base/Main.js:
(WI.loaded):
Move settings, and register for settings changes in contentLoaded.

* UserInterface/Base/Setting.js:
New settings, and sort values.

* UserInterface/Test/Test.js:
(WI.loaded):
Update setting values for tests.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):
* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager.prototype.initializeTarget):
* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.get children):
(WI.DOMNode.prototype.get nextSibling):
(WI.DOMNode.prototype.get previousSibling):
(WI.DOMNode.prototype.get childNodeCount):
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.initialize):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype.closed):
(WI.DOMTreeContentView.prototype._togglePaintFlashing):
(WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged):
(WI.DOMTreeContentView.prototype._showShadowDOMSettingChanged):
(WI.DOMTreeContentView.prototype._toggleShowsShadowDOMSetting):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline):
(WI.DOMTreeOutline.prototype.close):
(WI.DOMTreeOutline.prototype._revealAndSelectNode):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WI.LayerTreeDetailsSidebarPanel.prototype.initialLayout):
(WI.LayerTreeDetailsSidebarPanel.prototype._updateDisplayWithLayers):
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.closed):
(WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
(WI.Layers3DContentView.prototype._togglePaintFlashing):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.closed):
(WI.NetworkTableContentView.prototype._resourceCachingDisabledSettingChanged):
(WI.NetworkTableContentView.prototype._toggleDisableResourceCache):
* UserInterface/Views/ScriptContentView.js:
(WI.ScriptContentView):
(WI.ScriptContentView.prototype.closed):
(WI.ScriptContentView.prototype._contentDidPopulate):
(WI.ScriptContentView.prototype._enableControlFlowProfilerSettingChanged):
(WI.ScriptContentView.prototype._showJavaScriptTypeInformationSettingChanged):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.shown):
(WI.SourceCodeTextEditor.prototype._proceedPopulateWithContent):
(WI.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
(WI.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView):
(WI.TextResourceContentView.prototype.closed):
(WI.TextResourceContentView.prototype._contentDidPopulate):
(WI.TextResourceContentView.prototype._enableControlFlowProfilerSettingChanged):
(WI.TextResourceContentView.prototype._showJavaScriptTypeInformationSettingChanged):
Renamed setting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237661 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Base/Setting.js
Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js
Source/WebInspectorUI/UserInterface/Models/DOMNode.js
Source/WebInspectorUI/UserInterface/Protocol/Target.js
Source/WebInspectorUI/UserInterface/Test/Test.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js
Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js

index f01c2de..7e53cbe 100644 (file)
@@ -1,3 +1,78 @@
+2018-10-31  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Move a few remaining global WI settings to WI.settings
+        https://bugs.webkit.org/show_bug.cgi?id=191137
+
+        Reviewed by Brian Burg.
+
+        Move and better name some of the WI.settings created in Main.js
+        to WI.settings, alongside other global settings.
+
+        * UserInterface/Base/Main.js:
+        (WI.loaded):
+        Move settings, and register for settings changes in contentLoaded.
+
+        * UserInterface/Base/Setting.js:
+        New settings, and sort values.
+
+        * UserInterface/Test/Test.js:
+        (WI.loaded):
+        Update setting values for tests.
+
+        * UserInterface/Controllers/NetworkManager.js:
+        (WI.NetworkManager.prototype.initializeTarget):
+        * UserInterface/Controllers/RuntimeManager.js:
+        (WI.RuntimeManager.prototype.initializeTarget):
+        * UserInterface/Models/DOMNode.js:
+        (WI.DOMNode.prototype.get children):
+        (WI.DOMNode.prototype.get nextSibling):
+        (WI.DOMNode.prototype.get previousSibling):
+        (WI.DOMNode.prototype.get childNodeCount):
+        * UserInterface/Protocol/Target.js:
+        (WI.Target.prototype.initialize):
+        * UserInterface/Views/DOMTreeContentView.js:
+        (WI.DOMTreeContentView):
+        (WI.DOMTreeContentView.prototype.closed):
+        (WI.DOMTreeContentView.prototype._togglePaintFlashing):
+        (WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged):
+        (WI.DOMTreeContentView.prototype._showShadowDOMSettingChanged):
+        (WI.DOMTreeContentView.prototype._toggleShowsShadowDOMSetting):
+        * UserInterface/Views/DOMTreeOutline.js:
+        (WI.DOMTreeOutline):
+        (WI.DOMTreeOutline.prototype.close):
+        (WI.DOMTreeOutline.prototype._revealAndSelectNode):
+        * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
+        (WI.LayerTreeDetailsSidebarPanel.prototype.initialLayout):
+        (WI.LayerTreeDetailsSidebarPanel.prototype._updateDisplayWithLayers):
+        * UserInterface/Views/Layers3DContentView.js:
+        (WI.Layers3DContentView):
+        (WI.Layers3DContentView.prototype.closed):
+        (WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
+        (WI.Layers3DContentView.prototype._togglePaintFlashing):
+        * UserInterface/Views/NetworkTableContentView.js:
+        (WI.NetworkTableContentView):
+        (WI.NetworkTableContentView.prototype.closed):
+        (WI.NetworkTableContentView.prototype._resourceCachingDisabledSettingChanged):
+        (WI.NetworkTableContentView.prototype._toggleDisableResourceCache):
+        * UserInterface/Views/ScriptContentView.js:
+        (WI.ScriptContentView):
+        (WI.ScriptContentView.prototype.closed):
+        (WI.ScriptContentView.prototype._contentDidPopulate):
+        (WI.ScriptContentView.prototype._enableControlFlowProfilerSettingChanged):
+        (WI.ScriptContentView.prototype._showJavaScriptTypeInformationSettingChanged):
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WI.SourceCodeTextEditor.prototype.shown):
+        (WI.SourceCodeTextEditor.prototype._proceedPopulateWithContent):
+        (WI.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
+        (WI.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
+        * UserInterface/Views/TextResourceContentView.js:
+        (WI.TextResourceContentView):
+        (WI.TextResourceContentView.prototype.closed):
+        (WI.TextResourceContentView.prototype._contentDidPopulate):
+        (WI.TextResourceContentView.prototype._enableControlFlowProfilerSettingChanged):
+        (WI.TextResourceContentView.prototype._showJavaScriptTypeInformationSettingChanged):
+        Renamed setting.
+
 2018-10-31  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Styles: missing contextmenu items for links
index d250edf..be67717 100644 (file)
@@ -138,14 +138,6 @@ WI.loaded = function()
     this._showingSplitConsoleSetting = new WI.Setting("showing-split-console", false);
     this._openTabsSetting = new WI.Setting("open-tab-types", ["elements", "network", "debugger", "resources", "timeline", "storage", "canvas", "console"]);
     this._selectedTabIndexSetting = new WI.Setting("selected-tab-index", 0);
-    this.showShadowDOMSetting = new WI.Setting("show-shadow-dom", false);
-    this.showJavaScriptTypeInformationSetting = new WI.Setting("show-javascript-type-information", false);
-    this.showJavaScriptTypeInformationSetting.addEventListener(WI.Setting.Event.Changed, this._showJavaScriptTypeInformationSettingChanged, this);
-    this.enableControlFlowProfilerSetting = new WI.Setting("enable-control-flow-profiler", false);
-    this.enableControlFlowProfilerSetting.addEventListener(WI.Setting.Event.Changed, this._enableControlFlowProfilerSettingChanged, this);
-    this.showPaintRectsSetting = new WI.Setting("show-paint-rects", false);
-    this.resourceCachingDisabledSetting = new WI.Setting("disable-resource-caching", false);
-    this.resourceCachingDisabledSetting.addEventListener(WI.Setting.Event.Changed, this._resourceCachingDisabledSettingChanged, this);
 
     // State.
     this.printStylesEnabled = false;
@@ -206,6 +198,10 @@ WI.contentLoaded = function()
     document.body.classList.add(WI.sharedApp.debuggableType);
     document.body.setAttribute("dir", this.resolvedLayoutDirection());
 
+    WI.settings.showJavaScriptTypeInformation.addEventListener(WI.Setting.Event.Changed, this._showJavaScriptTypeInformationSettingChanged, this);
+    WI.settings.enableControlFlowProfiler.addEventListener(WI.Setting.Event.Changed, this._enableControlFlowProfilerSettingChanged, this);
+    WI.settings.resourceCachingDisabled.addEventListener(WI.Setting.Event.Changed, this._resourceCachingDisabledSettingChanged, this);
+
     function setTabSize() {
         document.body.style.tabSize = WI.settings.tabSize.value;
     }
@@ -2189,7 +2185,7 @@ WI._showTabAtIndex = function(i, event)
 
 WI._showJavaScriptTypeInformationSettingChanged = function(event)
 {
-    if (this.showJavaScriptTypeInformationSetting.value) {
+    if (WI.settings.showJavaScriptTypeInformation.value) {
         for (let target of WI.targets)
             target.RuntimeAgent.enableTypeProfiler();
     } else {
@@ -2200,7 +2196,7 @@ WI._showJavaScriptTypeInformationSettingChanged = function(event)
 
 WI._enableControlFlowProfilerSettingChanged = function(event)
 {
-    if (this.enableControlFlowProfilerSetting.value) {
+    if (WI.settings.enableControlFlowProfiler.value) {
         for (let target of WI.targets)
             target.RuntimeAgent.enableControlFlowProfiler();
     } else {
@@ -2211,7 +2207,7 @@ WI._enableControlFlowProfilerSettingChanged = function(event)
 
 WI._resourceCachingDisabledSettingChanged = function(event)
 {
-    NetworkAgent.setResourceCachingDisabled(this.resourceCachingDisabledSetting.value);
+    NetworkAgent.setResourceCachingDisabled(WI.settings.resourceCachingDisabled.value);
 };
 
 WI.elementDragStart = function(element, dividerDrag, elementDragEnd, event, cursor, eventTarget)
index cc2788d..f92b98c 100644 (file)
@@ -103,23 +103,28 @@ WI.Setting.Event = {
 };
 
 WI.settings = {
+    clearLogOnNavigate: new WI.Setting("clear-log-on-navigate", true),
+    clearNetworkOnNavigate: new WI.Setting("clear-network-on-navigate", true),
+    enableControlFlowProfiler: new WI.Setting("enable-control-flow-profiler", false),
     enableLineWrapping: new WI.Setting("enable-line-wrapping", false),
+    groupByDOMNode: new WI.Setting("group-by-dom-node", false),
     indentUnit: new WI.Setting("indent-unit", 4),
-    tabSize: new WI.Setting("tab-size", 4),
     indentWithTabs: new WI.Setting("indent-with-tabs", false),
-    showWhitespaceCharacters: new WI.Setting("show-whitespace-characters", false),
-    showInvalidCharacters: new WI.Setting("show-invalid-characters", false),
-    clearLogOnNavigate: new WI.Setting("clear-log-on-navigate", true),
-    clearNetworkOnNavigate: new WI.Setting("clear-network-on-navigate", true),
-    zoomFactor: new WI.Setting("zoom-factor", 1),
-    showScopeChainOnPause: new WI.Setting("show-scope-chain-sidebar", true),
-    showImageGrid: new WI.Setting("show-image-grid", false),
-    showCanvasPath: new WI.Setting("show-canvas-path", false),
+    resourceCachingDisabled: new WI.Setting("disable-resource-caching", false),
     selectedNetworkDetailContentViewIdentifier: new WI.Setting("network-detail-content-view-identifier", "preview"),
-    showRulers: new WI.Setting("show-rulers", false),
-    showAssertionFailuresBreakpoint: new WI.Setting("show-assertion-failures-breakpoint", true),
     showAllRequestsBreakpoint: new WI.Setting("show-all-requests-breakpoint", true),
-    groupByDOMNode: new WI.Setting("group-by-dom-node", false),
+    showAssertionFailuresBreakpoint: new WI.Setting("show-assertion-failures-breakpoint", true),
+    showCanvasPath: new WI.Setting("show-canvas-path", false),
+    showImageGrid: new WI.Setting("show-image-grid", false),
+    showInvalidCharacters: new WI.Setting("show-invalid-characters", false),
+    showJavaScriptTypeInformation: new WI.Setting("show-javascript-type-information", false),
+    showPaintRects: new WI.Setting("show-paint-rects", false),
+    showRulers: new WI.Setting("show-rulers", false),
+    showScopeChainOnPause: new WI.Setting("show-scope-chain-sidebar", true),
+    showShadowDOM: new WI.Setting("show-shadow-dom", false),
+    showWhitespaceCharacters: new WI.Setting("show-whitespace-characters", false),
+    tabSize: new WI.Setting("tab-size", 4),
+    zoomFactor: new WI.Setting("zoom-factor", 1),
 
     // Experimental
     experimentalEnableMultiplePropertiesSelection: new WI.Setting("experimental-enable-multiple-properties-selection", false),
index 4a8b307..f5caff6 100644 (file)
@@ -66,7 +66,7 @@ WI.NetworkManager = class NetworkManager extends WI.Object
 
             // COMPATIBILITY (iOS 10.3): Network.setDisableResourceCaching did not exist.
             if (NetworkAgent.setResourceCachingDisabled) {
-                if (WI.resourceCachingDisabledSetting && WI.resourceCachingDisabledSetting.value)
+                if (WI.settings.resourceCachingDisabled && WI.settings.resourceCachingDisabled.value)
                     target.NetworkAgent.setResourceCachingDisabled(true);
             }
         }
index 73b6af5..59df15d 100644 (file)
@@ -41,11 +41,11 @@ WI.RuntimeManager = class RuntimeManager extends WI.Object
         target.RuntimeAgent.enable();
 
         // COMPATIBILITY (iOS 8): Runtime.enableTypeProfiler did not exist.
-        if (WI.showJavaScriptTypeInformationSetting && WI.showJavaScriptTypeInformationSetting.value && RuntimeAgent.enableTypeProfiler)
+        if (WI.settings.showJavaScriptTypeInformation && WI.settings.showJavaScriptTypeInformation.value && RuntimeAgent.enableTypeProfiler)
             target.RuntimeAgent.enableTypeProfiler();
 
         // COMPATIBILITY (iOS 10): Runtime.enableControlFlowProfiler did not exist
-        if (WI.enableControlFlowProfilerSetting && WI.enableControlFlowProfilerSetting.value && RuntimeAgent.enableControlFlowProfiler)
+        if (WI.settings.enableControlFlowProfiler && WI.settings.enableControlFlowProfiler.value && RuntimeAgent.enableControlFlowProfiler)
             target.RuntimeAgent.enableControlFlowProfiler();
     }
 
index 7ead2de..02d938a 100644 (file)
@@ -176,7 +176,7 @@ WI.DOMNode = class DOMNode extends WI.Object
         if (!this._children)
             return null;
 
-        if (WI.showShadowDOMSetting.value)
+        if (WI.settings.showShadowDOM.value)
             return this._children;
 
         if (this._filteredChildrenNeedsUpdating) {
@@ -211,7 +211,7 @@ WI.DOMNode = class DOMNode extends WI.Object
 
     get nextSibling()
     {
-        if (WI.showShadowDOMSetting.value)
+        if (WI.settings.showShadowDOM.value)
             return this._nextSibling;
 
         var node = this._nextSibling;
@@ -225,7 +225,7 @@ WI.DOMNode = class DOMNode extends WI.Object
 
     get previousSibling()
     {
-        if (WI.showShadowDOMSetting.value)
+        if (WI.settings.showShadowDOM.value)
             return this._previousSibling;
 
         var node = this._previousSibling;
@@ -243,7 +243,7 @@ WI.DOMNode = class DOMNode extends WI.Object
         if (children)
             return children.length;
 
-        if (WI.showShadowDOMSetting.value)
+        if (WI.settings.showShadowDOM.value)
             return this._childNodeCount + this._shadowRoots.length;
 
         return this._childNodeCount;
index 0f6c335..dcd14c9 100644 (file)
@@ -65,7 +65,7 @@ WI.Target = class Target extends WI.Object
         // Non-manager specific initialization.
         // COMPATIBILITY (iOS 8): Page.setShowPaintRects did not exist.
         if (this.PageAgent) {
-            if (PageAgent.setShowPaintRects && WI.showPaintRectsSetting && WI.showPaintRectsSetting.value)
+            if (PageAgent.setShowPaintRects && WI.settings.showPaintRects.value)
                 this.PageAgent.setShowPaintRects(true);
         }
 
index 744afe7..5c6b9dc 100644 (file)
@@ -67,8 +67,8 @@ WI.loaded = function()
     // Register for events.
     document.addEventListener("DOMContentLoaded", this.contentLoaded);
 
-    // Global settings.
-    this.showShadowDOMSetting = new WI.Setting("show-shadow-dom", true);
+    // Non-default global setting values for tests.
+    WI.settings.showShadowDOM.value = true;
 
     // Targets.
     WI.mainTarget = new WI.MainTarget;
index 9d4d576..15292f2 100644 (file)
@@ -36,14 +36,14 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView
         this._compositingBordersButtonNavigationItem.enabled = !!PageAgent.getCompositingBordersVisible;
         this._compositingBordersButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
 
-        WI.showPaintRectsSetting.addEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this);
+        WI.settings.showPaintRects.addEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this);
         this._paintFlashingButtonNavigationItem = new WI.ActivateButtonNavigationItem("paint-flashing", WI.UIString("Enable paint flashing"), WI.UIString("Disable paint flashing"), "Images/Paint.svg", 16, 16);
         this._paintFlashingButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._togglePaintFlashing, this);
         this._paintFlashingButtonNavigationItem.enabled = !!PageAgent.setShowPaintRects;
-        this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.showPaintRectsSetting.value;
+        this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.settings.showPaintRects.value;
         this._paintFlashingButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
 
-        WI.showShadowDOMSetting.addEventListener(WI.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
+        WI.settings.showShadowDOM.addEventListener(WI.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
         this._showsShadowDOMButtonNavigationItem = new WI.ActivateButtonNavigationItem("shows-shadow-DOM", WI.UIString("Show shadow DOM nodes"), WI.UIString("Hide shadow DOM nodes"), "Images/ShadowDOM.svg", 13, 13);
         this._showsShadowDOMButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleShowsShadowDOMSetting, this);
         this._showsShadowDOMButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
@@ -159,8 +159,8 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView
     {
         super.closed();
 
-        WI.showPaintRectsSetting.removeEventListener(null, null, this);
-        WI.showShadowDOMSetting.removeEventListener(null, null, this);
+        WI.settings.showPaintRects.removeEventListener(null, null, this);
+        WI.settings.showShadowDOM.removeEventListener(null, null, this);
         WI.settings.showRulers.removeEventListener(null, null, this);
         WI.debuggerManager.removeEventListener(null, null, this);
         WI.domManager.removeEventListener(null, null, this);
@@ -529,7 +529,7 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView
 
     _togglePaintFlashing(event)
     {
-        WI.showPaintRectsSetting.value = !WI.showPaintRectsSetting.value;
+        WI.settings.showPaintRects.value = !WI.settings.showPaintRects.value;
     }
 
     _updateCompositingBordersButtonToMatchPageSettings()
@@ -551,19 +551,19 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView
     {
         console.assert(PageAgent.setShowPaintRects);
 
-        this._paintFlashingButtonNavigationItem.activated = WI.showPaintRectsSetting.value;
+        this._paintFlashingButtonNavigationItem.activated = WI.settings.showPaintRects.value;
 
         PageAgent.setShowPaintRects(this._paintFlashingButtonNavigationItem.activated);
     }
 
     _showShadowDOMSettingChanged(event)
     {
-        this._showsShadowDOMButtonNavigationItem.activated = WI.showShadowDOMSetting.value;
+        this._showsShadowDOMButtonNavigationItem.activated = WI.settings.showShadowDOM.value;
     }
 
     _toggleShowsShadowDOMSetting(event)
     {
-        WI.showShadowDOMSetting.value = !WI.showShadowDOMSetting.value;
+        WI.settings.showShadowDOM.value = !WI.settings.showShadowDOM.value;
     }
 
     _showPrintStylesChanged()
index 1082a9b..4ad432e 100644 (file)
@@ -58,7 +58,7 @@ WI.DOMTreeOutline = class DOMTreeOutline extends WI.TreeOutline
         this._hideElementKeyboardShortcut = new WI.KeyboardShortcut(null, "H", this._hideElement.bind(this), this.element);
         this._hideElementKeyboardShortcut.implicitlyPreventsDefault = false;
 
-        WI.showShadowDOMSetting.addEventListener(WI.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
+        WI.settings.showShadowDOM.addEventListener(WI.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
     }
 
     // Public
@@ -70,7 +70,7 @@ WI.DOMTreeOutline = class DOMTreeOutline extends WI.TreeOutline
 
     close()
     {
-        WI.showShadowDOMSetting.removeEventListener(null, null, this);
+        WI.settings.showShadowDOM.removeEventListener(null, null, this);
 
         if (this._elementsTreeUpdater) {
             this._elementsTreeUpdater.close();
@@ -277,7 +277,7 @@ WI.DOMTreeOutline = class DOMTreeOutline extends WI.TreeOutline
         if (!node || this._suppressRevealAndSelect)
             return;
 
-        if (!WI.showShadowDOMSetting.value) {
+        if (!WI.settings.showShadowDOM.value) {
             while (node && node.isInShadowTree())
                 node = node.parentNode;
             if (!node)
index 310a78f..4652e4f 100644 (file)
@@ -65,7 +65,7 @@ WI.LayerTreeDetailsSidebarPanel = class LayerTreeDetailsSidebarPanel extends WI.
     {
         super.initialLayout();
 
-        WI.showShadowDOMSetting.addEventListener(WI.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
+        WI.settings.showShadowDOM.addEventListener(WI.Setting.Event.Changed, this._showShadowDOMSettingChanged, this);
 
         this._buildLayerInfoSection();
         this._buildDataGridSection();
@@ -238,7 +238,7 @@ WI.LayerTreeDetailsSidebarPanel = class LayerTreeDetailsSidebarPanel extends WI.
 
     _updateDisplayWithLayers(layerForNode, childLayers)
     {
-        if (!WI.showShadowDOMSetting.value) {
+        if (!WI.settings.showShadowDOM.value) {
             childLayers = childLayers.filter(function(layer) {
                 return !layer.isInShadowTree;
             });
index c818f0c..94af03d 100644 (file)
@@ -35,11 +35,11 @@ WI.Layers3DContentView = class Layers3DContentView extends WI.ContentView
         this._compositingBordersButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleCompositingBorders, this);
         this._compositingBordersButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
 
-        WI.showPaintRectsSetting.addEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this);
+        WI.settings.showPaintRects.addEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this);
         this._paintFlashingButtonNavigationItem = new WI.ActivateButtonNavigationItem("paint-flashing", WI.UIString("Enable paint flashing"), WI.UIString("Disable paint flashing"), "Images/Paint.svg", 16, 16);
         this._paintFlashingButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._togglePaintFlashing, this);
         this._paintFlashingButtonNavigationItem.enabled = !!PageAgent.setShowPaintRects;
-        this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.showPaintRectsSetting.value;
+        this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.settings.showPaintRects.value;
         this._paintFlashingButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
 
         this._layers = [];
@@ -98,7 +98,7 @@ WI.Layers3DContentView = class Layers3DContentView extends WI.ContentView
 
     closed()
     {
-        WI.showPaintRectsSetting.removeEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this);
+        WI.settings.showPaintRects.removeEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this);
 
         super.closed();
     }
@@ -394,13 +394,13 @@ WI.Layers3DContentView = class Layers3DContentView extends WI.ContentView
     {
         console.assert(PageAgent.setShowPaintRects);
 
-        this._paintFlashingButtonNavigationItem.activated = WI.showPaintRectsSetting.value;
+        this._paintFlashingButtonNavigationItem.activated = WI.settings.showPaintRects.value;
         PageAgent.setShowPaintRects(this._paintFlashingButtonNavigationItem.activated);
     }
 
     _togglePaintFlashing(event)
     {
-        WI.showPaintRectsSetting.value = !WI.showPaintRectsSetting.value;
+        WI.settings.showPaintRects.value = !WI.settings.showPaintRects.value;
     }
 
     _updateCompositingBordersButtonState()
index fb630eb..83237f4 100644 (file)
@@ -121,10 +121,10 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
             let toolTipForDisableResourceCache = WI.UIString("Ignore the resource cache when loading resources");
             let activatedToolTipForDisableResourceCache = WI.UIString("Use the resource cache when loading resources");
             this._disableResourceCacheNavigationItem = new WI.ActivateButtonNavigationItem("disable-resource-cache", toolTipForDisableResourceCache, activatedToolTipForDisableResourceCache, "Images/IgnoreCaches.svg", 16, 16);
-            this._disableResourceCacheNavigationItem.activated = WI.resourceCachingDisabledSetting.value;
+            this._disableResourceCacheNavigationItem.activated = WI.settings.resourceCachingDisabled.value;
 
             this._disableResourceCacheNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleDisableResourceCache, this);
-            WI.resourceCachingDisabledSetting.addEventListener(WI.Setting.Event.Changed, this._resourceCachingDisabledSettingChanged, this);
+            WI.settings.resourceCachingDisabled.addEventListener(WI.Setting.Event.Changed, this._resourceCachingDisabledSettingChanged, this);
         }
 
         this._clearNetworkItemsNavigationItem = new WI.ButtonNavigationItem("clear-network-items", WI.UIString("Clear Network Items (%s)").format(WI.clearKeyboardShortcut.displayName), "Images/NavigationItemTrash.svg", 15, 15);
@@ -252,7 +252,7 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
 
         WI.Frame.removeEventListener(null, null, this);
         WI.Resource.removeEventListener(null, null, this);
-        WI.resourceCachingDisabledSetting.removeEventListener(null, null, this);
+        WI.settings.resourceCachingDisabled.removeEventListener(null, null, this);
         WI.settings.clearNetworkOnNavigate.removeEventListener(null, null, this);
         WI.networkManager.removeEventListener(WI.NetworkManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
         WI.timelineManager.persistentNetworkTimeline.removeEventListener(WI.Timeline.Event.RecordAdded, this._networkTimelineRecordAdded, this);
@@ -1366,12 +1366,12 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
 
     _resourceCachingDisabledSettingChanged()
     {
-        this._disableResourceCacheNavigationItem.activated = WI.resourceCachingDisabledSetting.value;
+        this._disableResourceCacheNavigationItem.activated = WI.settings.resourceCachingDisabled.value;
     }
 
     _toggleDisableResourceCache()
     {
-        WI.resourceCachingDisabledSetting.value = !WI.resourceCachingDisabledSetting.value;
+        WI.settings.resourceCachingDisabled.value = !WI.settings.resourceCachingDisabled.value;
     }
 
     _mainResourceDidChange(event)
index ae88a7f..2ef44d4 100644 (file)
@@ -59,7 +59,7 @@ WI.ScriptContentView = class ScriptContentView extends WI.ContentView
         this._showTypesButtonNavigationItem.enabled = false;
         this._showTypesButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
 
-        WI.showJavaScriptTypeInformationSetting.addEventListener(WI.Setting.Event.Changed, this._showJavaScriptTypeInformationSettingChanged, this);
+        WI.settings.showJavaScriptTypeInformation.addEventListener(WI.Setting.Event.Changed, this._showJavaScriptTypeInformationSettingChanged, this);
 
         let toolTipCodeCoverage = WI.UIString("Fade unexecuted code");
         let activatedToolTipCodeCoverage = WI.UIString("Do not fade unexecuted code");
@@ -68,7 +68,7 @@ WI.ScriptContentView = class ScriptContentView extends WI.ContentView
         this._codeCoverageButtonNavigationItem.enabled = false;
         this._codeCoverageButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
 
-        WI.enableControlFlowProfilerSetting.addEventListener(WI.Setting.Event.Changed, this._enableControlFlowProfilerSettingChanged, this);
+        WI.settings.enableControlFlowProfiler.addEventListener(WI.Setting.Event.Changed, this._enableControlFlowProfilerSettingChanged, this);
 
         this._textEditor = new WI.SourceCodeTextEditor(script);
         this._textEditor.addEventListener(WI.TextEditor.Event.ExecutionLineNumberDidChange, this._executionLineNumberDidChange, this);
@@ -129,8 +129,8 @@ WI.ScriptContentView = class ScriptContentView extends WI.ContentView
     {
         super.closed();
 
-        WI.showJavaScriptTypeInformationSetting.removeEventListener(null, null, this);
-        WI.enableControlFlowProfilerSetting.removeEventListener(null, null, this);
+        WI.settings.showJavaScriptTypeInformation.removeEventListener(null, null, this);
+        WI.settings.enableControlFlowProfiler.removeEventListener(null, null, this);
 
         this._textEditor.close();
     }
@@ -223,10 +223,10 @@ WI.ScriptContentView = class ScriptContentView extends WI.ContentView
         this._prettyPrintButtonNavigationItem.enabled = this._textEditor.canBeFormatted();
 
         this._showTypesButtonNavigationItem.enabled = this._textEditor.canShowTypeAnnotations();
-        this._showTypesButtonNavigationItem.activated = WI.showJavaScriptTypeInformationSetting.value;
+        this._showTypesButtonNavigationItem.activated = WI.settings.showJavaScriptTypeInformation.value;
 
         this._codeCoverageButtonNavigationItem.enabled = this._textEditor.canShowCoverageHints();
-        this._codeCoverageButtonNavigationItem.activated = WI.enableControlFlowProfilerSetting.value;
+        this._codeCoverageButtonNavigationItem.activated = WI.settings.enableControlFlowProfiler.value;
     }
 
     _togglePrettyPrint(event)
@@ -253,12 +253,12 @@ WI.ScriptContentView = class ScriptContentView extends WI.ContentView
 
     _showJavaScriptTypeInformationSettingChanged(event)
     {
-        this._showTypesButtonNavigationItem.activated = WI.showJavaScriptTypeInformationSetting.value;
+        this._showTypesButtonNavigationItem.activated = WI.settings.showJavaScriptTypeInformation.value;
     }
 
     _enableControlFlowProfilerSettingChanged(event)
     {
-        this._codeCoverageButtonNavigationItem.activated = WI.enableControlFlowProfilerSetting.value;
+        this._codeCoverageButtonNavigationItem.activated = WI.settings.enableControlFlowProfiler.value;
     }
 
     _textEditorFormattingDidChange(event)
index be01e34..3edbc1c 100644 (file)
@@ -126,7 +126,7 @@ WI.SourceCodeTextEditor = class SourceCodeTextEditor extends WI.TextEditor
     {
         super.shown();
 
-        if (WI.showJavaScriptTypeInformationSetting.value) {
+        if (WI.settings.showJavaScriptTypeInformation.value) {
             if (this._typeTokenAnnotator)
                 this._typeTokenAnnotator.resume();
             if (!this._typeTokenScrollHandler && this._typeTokenAnnotator)
@@ -136,7 +136,7 @@ WI.SourceCodeTextEditor = class SourceCodeTextEditor extends WI.TextEditor
                 this._setTypeTokenAnnotatorEnabledState(false);
         }
 
-        if (WI.enableControlFlowProfilerSetting.value) {
+        if (WI.settings.enableControlFlowProfiler.value) {
             if (this._basicBlockAnnotator)
                 this._basicBlockAnnotator.resume();
 
@@ -464,11 +464,11 @@ WI.SourceCodeTextEditor = class SourceCodeTextEditor extends WI.TextEditor
         this.string = content;
 
         this._createBasicBlockAnnotator();
-        if (WI.enableControlFlowProfilerSetting.value && this._basicBlockAnnotator)
+        if (WI.settings.enableControlFlowProfiler.value && this._basicBlockAnnotator)
             this._basicBlockAnnotatorEnabled = true;
 
         this._createTypeTokenAnnotator();
-        if (WI.showJavaScriptTypeInformationSetting.value)
+        if (WI.settings.showJavaScriptTypeInformation.value)
             this._setTypeTokenAnnotatorEnabledState(true);
 
         this._contentDidPopulate();
@@ -2098,7 +2098,7 @@ WI.SourceCodeTextEditor = class SourceCodeTextEditor extends WI.TextEditor
                 this._disableScrollEventsForTypeTokenAnnotator();
         }
 
-        WI.showJavaScriptTypeInformationSetting.value = shouldActivate;
+        WI.settings.showJavaScriptTypeInformation.value = shouldActivate;
 
         this._updateTokenTrackingControllerState();
     }
@@ -2123,7 +2123,7 @@ WI.SourceCodeTextEditor = class SourceCodeTextEditor extends WI.TextEditor
                 this._disableScrollEventsForControlFlowAnnotator();
         }
 
-        WI.enableControlFlowProfilerSetting.value = shouldActivate;
+        WI.settings.enableControlFlowProfiler.value = shouldActivate;
     }
 
     _getAssociatedScript(position)
index dbf8b3f..d4fc48e 100644 (file)
@@ -44,7 +44,7 @@ WI.TextResourceContentView = class TextResourceContentView extends WI.ResourceCo
         this._showTypesButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleTypeAnnotations, this);
         this._showTypesButtonNavigationItem.enabled = false;
         this._showTypesButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
-        WI.showJavaScriptTypeInformationSetting.addEventListener(WI.Setting.Event.Changed, this._showJavaScriptTypeInformationSettingChanged, this);
+        WI.settings.showJavaScriptTypeInformation.addEventListener(WI.Setting.Event.Changed, this._showJavaScriptTypeInformationSettingChanged, this);
 
         let toolTipCodeCoverage = WI.UIString("Fade unexecuted code");
         let activatedToolTipCodeCoverage = WI.UIString("Do not fade unexecuted code");
@@ -52,7 +52,7 @@ WI.TextResourceContentView = class TextResourceContentView extends WI.ResourceCo
         this._codeCoverageButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleUnexecutedCodeHighlights, this);
         this._codeCoverageButtonNavigationItem.enabled = false;
         this._codeCoverageButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low;
-        WI.enableControlFlowProfilerSetting.addEventListener(WI.Setting.Event.Changed, this._enableControlFlowProfilerSettingChanged, this);
+        WI.settings.enableControlFlowProfiler.addEventListener(WI.Setting.Event.Changed, this._enableControlFlowProfilerSettingChanged, this);
 
         this._textEditor = new WI.SourceCodeTextEditor(resource);
         this._textEditor.addEventListener(WI.TextEditor.Event.ExecutionLineNumberDidChange, this._executionLineNumberDidChange, this);
@@ -125,8 +125,8 @@ WI.TextResourceContentView = class TextResourceContentView extends WI.ResourceCo
 
         this.resource.removeEventListener(null, null, this);
         WI.debuggerManager.removeEventListener(null, null, this);
-        WI.showJavaScriptTypeInformationSetting.removeEventListener(null, null, this);
-        WI.enableControlFlowProfilerSetting.removeEventListener(null, null, this);
+        WI.settings.showJavaScriptTypeInformation.removeEventListener(null, null, this);
+        WI.settings.enableControlFlowProfiler.removeEventListener(null, null, this);
 
         this._textEditor.close();
     }
@@ -210,10 +210,10 @@ WI.TextResourceContentView = class TextResourceContentView extends WI.ResourceCo
         this._prettyPrintButtonNavigationItem.enabled = this._textEditor.canBeFormatted();
 
         this._showTypesButtonNavigationItem.enabled = this._textEditor.canShowTypeAnnotations();
-        this._showTypesButtonNavigationItem.activated = WI.showJavaScriptTypeInformationSetting.value;
+        this._showTypesButtonNavigationItem.activated = WI.settings.showJavaScriptTypeInformation.value;
 
         this._codeCoverageButtonNavigationItem.enabled = this._textEditor.canShowCoverageHints();
-        this._codeCoverageButtonNavigationItem.activated = WI.enableControlFlowProfilerSetting.value;
+        this._codeCoverageButtonNavigationItem.activated = WI.settings.enableControlFlowProfiler.value;
 
         if (!this._textEditor.string)
             this.showGenericNoContentMessage();
@@ -243,12 +243,12 @@ WI.TextResourceContentView = class TextResourceContentView extends WI.ResourceCo
 
     _showJavaScriptTypeInformationSettingChanged(event)
     {
-        this._showTypesButtonNavigationItem.activated = WI.showJavaScriptTypeInformationSetting.value;
+        this._showTypesButtonNavigationItem.activated = WI.settings.showJavaScriptTypeInformation.value;
     }
 
     _enableControlFlowProfilerSettingChanged(event)
     {
-        this._codeCoverageButtonNavigationItem.activated = WI.enableControlFlowProfilerSetting.value;
+        this._codeCoverageButtonNavigationItem.activated = WI.settings.enableControlFlowProfiler.value;
     }
 
     _textEditorFormattingDidChange(event)