Web Inspector: add WI.EngineeringSetting and WI.DebugSetting to avoid callsite checking
https://bugs.webkit.org/show_bug.cgi?id=204785

Reviewed by Timothy Hatcher.

* UserInterface/Base/Setting.js:
(WI.Setting.prototype.get defaultValue): Added.
(WI.EngineeringSetting.prototype.get value): Added.
(WI.EngineeringSetting.prototype.set value): Added.
(WI.DebugSetting.prototype.get value): Added.
(WI.DebugSetting.prototype.set value): Added.
(WI.Setting.prototype.get valueRespectingDebugUIAvailability): Deleted.
Only get/set the `_value` if the `WI.isEngineeringBuild`/`WI.isDebugUIEnabled()`.

* UserInterface/Base/Main.js:
(WI.resolvedLayoutDirection):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):
* UserInterface/Proxies/HeapSnapshotEdgeProxy.js:
(WI.HeapSnapshotEdgeProxy.prototype.isPrivateSymbol):
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.supportsEditingUserAgentShadowTrees):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.get knownNonResourceScripts):
(WI.DebuggerManager.prototype.debuggerDidPause):
(WI.DebuggerManager.prototype.scriptDidParse):
* UserInterface/Controllers/DiagnosticController.js:
(WI.DiagnosticController):
(WI.DiagnosticController.prototype._debugAutoLogDiagnosticEventsSettingDidChange):
(WI.DiagnosticController.prototype._updateRecorderStates):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):
* UserInterface/Debug/UncaughtExceptionReporter.js:
(handleUncaughtExceptionRecord):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog
index 5729928..553d8f0 100644
--- a/Source/WebInspectorUI/ChangeLog
+++ b/Source/WebInspectorUI/ChangeLog
@@ -1,5 +1,56 @@
 2019-12-05  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: add WI.EngineeringSetting and WI.DebugSetting to avoid callsite checking
+        https://bugs.webkit.org/show_bug.cgi?id=204785
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Setting.js:
+        (WI.Setting.prototype.get defaultValue): Added.
+        (WI.EngineeringSetting.prototype.get value): Added.
+        (WI.EngineeringSetting.prototype.set value): Added.
+        (WI.DebugSetting.prototype.get value): Added.
+        (WI.DebugSetting.prototype.set value): Added.
+        (WI.Setting.prototype.get valueRespectingDebugUIAvailability): Deleted.
+        Only get/set the `_value` if the `WI.isEngineeringBuild`/`WI.isDebugUIEnabled()`.
+
+        * UserInterface/Base/Main.js:
+        (WI.resolvedLayoutDirection):
+        * UserInterface/Protocol/RemoteObject.js:
+        (WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
+        * UserInterface/Models/CSSProperty.js:
+        (WI.CSSProperty.prototype._updateOwnerStyleText):
+        * UserInterface/Models/CSSStyleDeclaration.js:
+        (WI.CSSStyleDeclaration.prototype.update):
+        * UserInterface/Proxies/HeapSnapshotEdgeProxy.js:
+        (WI.HeapSnapshotEdgeProxy.prototype.isPrivateSymbol):
+        * UserInterface/Controllers/DOMManager.js:
+        (WI.DOMManager.prototype.supportsEditingUserAgentShadowTrees):
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WI.DebuggerManager.prototype.get knownNonResourceScripts):
+        (WI.DebuggerManager.prototype.debuggerDidPause):
+        (WI.DebuggerManager.prototype.scriptDidParse):
+        * UserInterface/Controllers/DiagnosticController.js:
+        (WI.DiagnosticController):
+        (WI.DiagnosticController.prototype._debugAutoLogDiagnosticEventsSettingDidChange):
+        (WI.DiagnosticController.prototype._updateRecorderStates):
+        * UserInterface/Views/ConsoleMessageView.js:
+        (WI.ConsoleMessageView.prototype._appendLocationLink):
+        * UserInterface/Views/HeapSnapshotDataGridTree.js:
+        (WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
+        * UserInterface/Views/OpenResourceDialog.js:
+        (WI.OpenResourceDialog.prototype._addScriptsForTarget):
+        * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
+        (WI.SpreadsheetCSSStyleDeclarationEditor):
+        * UserInterface/Views/StackTraceView.js:
+        (WI.StackTraceView):
+        * UserInterface/Views/View.js:
+        (WI.View.prototype._layoutSubtree):
+        * UserInterface/Debug/UncaughtExceptionReporter.js:
+        (handleUncaughtExceptionRecord):
+
+2019-12-05  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: Console: copying an evaluation result shouldn't include the saved variable index
         https://bugs.webkit.org/show_bug.cgi?id=204906
 
diff --git a/Source/WebInspectorUI/UserInterface/Base/Main.js b/Source/WebInspectorUI/UserInterface/Base/Main.js
index 3711b2a..6d81cfc 100644
--- a/Source/WebInspectorUI/UserInterface/Base/Main.js
+++ b/Source/WebInspectorUI/UserInterface/Base/Main.js
@@ -2641,7 +2641,7 @@
 WI.resolvedLayoutDirection = function()
 {
     let layoutDirection = WI.settings.debugLayoutDirection.value;
-    if (!WI.isDebugUIEnabled() || layoutDirection === WI.LayoutDirection.System)
+    if (layoutDirection === WI.LayoutDirection.System)
         layoutDirection = InspectorFrontendHost.userInterfaceLayoutDirection();
     return layoutDirection;
 };
diff --git a/Source/WebInspectorUI/UserInterface/Base/Setting.js b/Source/WebInspectorUI/UserInterface/Base/Setting.js
index 8060c41..7ecb788 100644
--- a/Source/WebInspectorUI/UserInterface/Base/Setting.js
+++ b/Source/WebInspectorUI/UserInterface/Base/Setting.js
@@ -82,10 +82,8 @@
 
     // Public
 
-    get name()
-    {
-        return this._name;
-    }
+    get name() { return this._name; }
+    get defaultValue() { return this._defaultValue; }
 
     get value()
     {
@@ -116,14 +114,6 @@
         this.save();
     }
 
-    get valueRespectingDebugUIAvailability()
-    {
-        if (this._name.startsWith("debug-") || this._name.startsWith("engineering-"))
-            return WI.isDebugUIEnabled() ? this.value : this._defaultValue;
-
-        return this.value;
-    }
-
     save()
     {
         if (!window.InspectorTest && window.localStorage) {
@@ -151,6 +141,40 @@
     Changed: "setting-changed"
 };
 
+WI.EngineeringSetting = class EngineeringSetting extends WI.Setting
+{
+    get value()
+    {
+        if (WI.isEngineeringBuild)
+            return super.value;
+        return this.defaultValue;
+    }
+
+    set value(value)
+    {
+        console.assert(WI.isEngineeringBuild);
+        if (WI.isEngineeringBuild)
+            super.value = value;
+    }
+};
+
+WI.DebugSetting = class DebugSetting extends WI.Setting
+{
+    get value()
+    {
+        if (WI.isDebugUIEnabled())
+            return super.value;
+        return this.defaultValue;
+    }
+
+    set value(value)
+    {
+        console.assert(WI.isDebugUIEnabled());
+        if (WI.isDebugUIEnabled())
+            super.value = value;
+    }
+};
+
 WI.settings = {
     canvasRecordingAutoCaptureEnabled: new WI.Setting("canvas-recording-auto-capture-enabled", false),
     canvasRecordingAutoCaptureFrameCount: new WI.Setting("canvas-recording-auto-capture-frame-count", 1),
@@ -205,20 +229,20 @@
     protocolFilterMultiplexingBackendMessages: new WI.Setting("protocol-filter-multiplexing-backend-messages", true),
 
     // Engineering
-    engineeringShowInternalScripts: new WI.Setting("engineering-show-internal-scripts", false),
-    engineeringPauseForInternalScripts: new WI.Setting("engineering-pause-for-internal-scripts", false),
-    engineeringShowInternalObjectsInHeapSnapshot: new WI.Setting("engineering-show-internal-objects-in-heap-snapshot", false),
-    engineeringShowPrivateSymbolsInHeapSnapshot: new WI.Setting("engineering-show-private-symbols-in-heap-snapshot", false),
-    engineeringAllowEditingUserAgentShadowTrees: new WI.Setting("engineering-allow-editing-user-agent-shadow-trees", false),
+    engineeringShowInternalScripts: new WI.EngineeringSetting("engineering-show-internal-scripts", false),
+    engineeringPauseForInternalScripts: new WI.EngineeringSetting("engineering-pause-for-internal-scripts", false),
+    engineeringShowInternalObjectsInHeapSnapshot: new WI.EngineeringSetting("engineering-show-internal-objects-in-heap-snapshot", false),
+    engineeringShowPrivateSymbolsInHeapSnapshot: new WI.EngineeringSetting("engineering-show-private-symbols-in-heap-snapshot", false),
+    engineeringAllowEditingUserAgentShadowTrees: new WI.EngineeringSetting("engineering-allow-editing-user-agent-shadow-trees", false),
 
     // Debug
-    debugShowConsoleEvaluations: new WI.Setting("debug-show-console-evaluations", false),
-    debugEnableLayoutFlashing: new WI.Setting("debug-enable-layout-flashing", false),
-    debugEnableStyleEditingDebugMode: new WI.Setting("debug-enable-style-editing-debug-mode", false),
-    debugEnableUncaughtExceptionReporter: new WI.Setting("debug-enable-uncaught-exception-reporter", true),
-    debugEnableDiagnosticLogging: new WI.Setting("debug-enable-diagnostic-logging", true),
-    debugAutoLogDiagnosticEvents: new WI.Setting("debug-auto-log-diagnostic-events", false),
-    debugLayoutDirection: new WI.Setting("debug-layout-direction-override", "system"),
+    debugShowConsoleEvaluations: new WI.DebugSetting("debug-show-console-evaluations", false),
+    debugEnableLayoutFlashing: new WI.DebugSetting("debug-enable-layout-flashing", false),
+    debugEnableStyleEditingDebugMode: new WI.DebugSetting("debug-enable-style-editing-debug-mode", false),
+    debugEnableUncaughtExceptionReporter: new WI.DebugSetting("debug-enable-uncaught-exception-reporter", true),
+    debugEnableDiagnosticLogging: new WI.DebugSetting("debug-enable-diagnostic-logging", true),
+    debugAutoLogDiagnosticEvents: new WI.DebugSetting("debug-auto-log-diagnostic-events", false),
+    debugLayoutDirection: new WI.DebugSetting("debug-layout-direction-override", "system"),
 };
 
 WI.previewFeatures = [
diff --git a/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js b/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
index 599f398..669ef9e 100644
--- a/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
+++ b/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
@@ -96,8 +96,7 @@
     static supportsEditingUserAgentShadowTrees({frontendOnly, target} = {})
     {
         target = target || InspectorBackend;
-        return WI.isEngineeringBuild
-            && WI.settings.engineeringAllowEditingUserAgentShadowTrees.value
+        return WI.settings.engineeringAllowEditingUserAgentShadowTrees.value
             && (frontendOnly || target.hasCommand("DOM.setAllowEditingUserAgentShadowTrees"));
 
     }
diff --git a/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js b/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
index 5896d28..1987a02 100644
--- a/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
+++ b/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
@@ -410,9 +410,9 @@
             for (let script of targetData.scripts) {
                 if (script.resource)
                     continue;
-                if ((!WI.isDebugUIEnabled() || !WI.settings.debugShowConsoleEvaluations.value) && isWebInspectorConsoleEvaluationScript(script.sourceURL))
+                if (!WI.settings.debugShowConsoleEvaluations.value && isWebInspectorConsoleEvaluationScript(script.sourceURL))
                     continue;
-                if ((!WI.isEngineeringBuild || !WI.settings.engineeringShowInternalScripts.value) && isWebKitInternalScript(script.sourceURL))
+                if (!WI.settings.engineeringShowInternalScripts.value && isWebKitInternalScript(script.sourceURL))
                     continue;
                 knownScripts.push(script);
             }
@@ -772,7 +772,7 @@
                 continue;
 
             // Exclude the case where the call frame is in the inspector code.
-            if ((!WI.isEngineeringBuild || !WI.settings.engineeringShowInternalScripts.value) && isWebKitInternalScript(sourceCodeLocation.sourceCode.sourceURL))
+            if (!WI.settings.engineeringShowInternalScripts.value && isWebKitInternalScript(sourceCodeLocation.sourceCode.sourceURL))
                 continue;
 
             let scopeChain = this._scopeChainFromPayload(target, callFramePayload.scopeChain);
@@ -855,7 +855,7 @@
             return;
         }
 
-        if ((!WI.isEngineeringBuild || !WI.settings.engineeringShowInternalScripts.value) && isWebKitInternalScript(sourceURL))
+        if (!WI.settings.engineeringShowInternalScripts.value && isWebKitInternalScript(sourceURL))
             return;
 
         let range = new WI.TextRange(startLine, startColumn, endLine, endColumn);
@@ -885,11 +885,11 @@
 
         if (isWebKitInternalScript(script.sourceURL)) {
             this._internalWebKitScripts.push(script);
-            if (!WI.isEngineeringBuild || !WI.settings.engineeringShowInternalScripts.value)
+            if (!WI.settings.engineeringShowInternalScripts.value)
                 return;
         }
 
-        if ((!WI.isDebugUIEnabled() || !WI.settings.debugShowConsoleEvaluations.value) && isWebInspectorConsoleEvaluationScript(script.sourceURL))
+        if (!WI.settings.debugShowConsoleEvaluations.value && isWebInspectorConsoleEvaluationScript(script.sourceURL))
             return;
 
         this.dispatchEventToListeners(WI.DebuggerManager.Event.ScriptAdded, {script});
diff --git a/Source/WebInspectorUI/UserInterface/Controllers/DiagnosticController.js b/Source/WebInspectorUI/UserInterface/Controllers/DiagnosticController.js
index cf83ca3..1b2240e 100644
--- a/Source/WebInspectorUI/UserInterface/Controllers/DiagnosticController.js
+++ b/Source/WebInspectorUI/UserInterface/Controllers/DiagnosticController.js
@@ -30,7 +30,7 @@
         this._diagnosticLoggingAvailable = false;
         this._recorders = new Set;
 
-        this._autoLogDiagnosticEventsToConsole = WI.settings.debugAutoLogDiagnosticEvents.valueRespectingDebugUIAvailability;
+        this._autoLogDiagnosticEventsToConsole = WI.settings.debugAutoLogDiagnosticEvents.value;
         this._logToConsoleMethod = window.InspectorTest ? InspectorTest.log.bind(InspectorTest) : console.log;
 
         WI.settings.debugEnableDiagnosticLogging.addEventListener(WI.Setting.Event.Changed, this._debugEnableDiagnosticLoggingSettingDidChange, this);
@@ -83,12 +83,12 @@
 
     _debugAutoLogDiagnosticEventsSettingDidChange()
     {
-        this._autoLogDiagnosticEventsToConsole = WI.settings.debugAutoLogDiagnosticEvents.valueRespectingDebugUIAvailability;
+        this._autoLogDiagnosticEventsToConsole = WI.settings.debugAutoLogDiagnosticEvents.value;
     }
 
     _updateRecorderStates()
     {
-        let isActive = this._diagnosticLoggingAvailable && WI.settings.debugEnableDiagnosticLogging.valueRespectingDebugUIAvailability;
+        let isActive = this._diagnosticLoggingAvailable && WI.settings.debugEnableDiagnosticLogging.value;
         for (let recorder of this._recorders)
             recorder.active = isActive;
     }
diff --git a/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js b/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js
index a31cd48..2debcc8 100644
--- a/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js
+++ b/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js
@@ -94,7 +94,7 @@
 
 function handleUncaughtExceptionRecord(exceptionRecord) {
     try {
-        if (WI.isDebugUIEnabled() && !WI.settings.debugEnableUncaughtExceptionReporter.value)
+        if (!WI.settings.debugEnableUncaughtExceptionReporter.value)
             return;
     } catch { }
 
diff --git a/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js b/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
index 64c8358..278a671 100644
--- a/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
+++ b/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
@@ -502,7 +502,7 @@
 
         console.assert(oldText === styleText.slice(range.startOffset, range.endOffset), "_styleSheetTextRange data is invalid.");
 
-        if (WI.isDebugUIEnabled() && WI.settings.debugEnableStyleEditingDebugMode.value) {
+        if (WI.settings.debugEnableStyleEditingDebugMode.value) {
             let prefix = styleText.slice(0, range.startOffset);
             let postfix = styleText.slice(range.endOffset);
             console.info(`${prefix}%c${oldText}%c${newText}%c${postfix}`, `background: hsl(356, 100%, 90%); color: black`, `background: hsl(100, 100%, 91%); color: black`, `background: transparent`);
diff --git a/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js b/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js
index 02b6074..43fdabd 100644
--- a/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js
+++ b/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js
@@ -124,7 +124,7 @@
         //                                  ^
         //                                  update only happens here
         if (this._updatesInProgressCount > 0 && !options.forceUpdate) {
-            if (WI.isDebugUIEnabled() && WI.settings.debugEnableStyleEditingDebugMode.value && text !== this._text)
+            if (WI.settings.debugEnableStyleEditingDebugMode.value && text !== this._text)
                 console.warn("Style modified while editing:", text);
 
             return;
diff --git a/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js b/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
index 9d552da..aa0e44d4 100644
--- a/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
+++ b/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
@@ -594,7 +594,7 @@
             var location = response.location;
             var sourceCode = WI.debuggerManager.scriptForIdentifier(location.scriptId, this._target);
 
-            if (!sourceCode || ((!WI.isEngineeringBuild || !WI.settings.engineeringShowInternalScripts.value) && isWebKitInternalScript(sourceCode.sourceURL))) {
+            if (!sourceCode || (!WI.settings.engineeringShowInternalScripts.value && isWebKitInternalScript(sourceCode.sourceURL))) {
                 result.resolve(WI.RemoteObject.SourceCodeLocationPromise.NoSourceFound);
                 return;
             }
diff --git a/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotEdgeProxy.js b/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotEdgeProxy.js
index f85f5b2..f1ad920 100644
--- a/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotEdgeProxy.js
+++ b/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotEdgeProxy.js
@@ -44,7 +44,7 @@
 
     isPrivateSymbol()
     {
-        if (WI.isEngineeringBuild && WI.settings.engineeringShowPrivateSymbolsInHeapSnapshot.value)
+        if (WI.settings.engineeringShowPrivateSymbolsInHeapSnapshot.value)
             return false;
 
         return typeof this.data === "string" && this.data.startsWith("PrivateSymbol");
diff --git a/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js b/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js
index 339e79f..03f6929 100644
--- a/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js
+++ b/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js
@@ -440,7 +440,7 @@
             });
         }
 
-        if (callFrame && (!callFrame.isConsoleEvaluation || (WI.isDebugUIEnabled() && WI.settings.debugShowConsoleEvaluations.value))) {
+        if (callFrame && (!callFrame.isConsoleEvaluation || WI.settings.debugShowConsoleEvaluations.value)) {
             let existingCallFrameView = this._callFrameView;
 
             this._callFrameView = new WI.CallFrameView(callFrame, {showFunctionName: !!callFrame.functionName});
diff --git a/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js b/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js
index 4e02e0a..d28f06a 100644
--- a/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js
+++ b/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js
@@ -216,7 +216,7 @@
     populateTopLevel()
     {
         // Populate the first level with the different classes.
-        let skipInternalOnlyObjects = !WI.isEngineeringBuild || !WI.settings.engineeringShowInternalObjectsInHeapSnapshot.value;
+        let skipInternalOnlyObjects = !WI.settings.engineeringShowInternalObjectsInHeapSnapshot.value;
 
         for (let [className, {size, retainedSize, count, internalCount, deadCount, objectCount}] of this.heapSnapshot.categories) {
             console.assert(count > 0);
diff --git a/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js b/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js
index 7127af9..1eaecdc 100644
--- a/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js
+++ b/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js
@@ -340,9 +340,9 @@
                 continue;
             if (script.dynamicallyAddedScriptElement)
                 continue;
-            if ((!WI.isDebugUIEnabled() || !WI.settings.debugShowConsoleEvaluations.value) || isWebInspectorConsoleEvaluationScript(script.sourceURL))
+            if (!WI.settings.debugShowConsoleEvaluations.value && isWebInspectorConsoleEvaluationScript(script.sourceURL))
                 continue;
-            if ((!WI.isEngineeringBuild || !WI.settings.engineeringShowInternalScripts.value) && isWebKitInternalScript(script.sourceURL))
+            if (!WI.settings.engineeringShowInternalScripts.value && isWebKitInternalScript(script.sourceURL))
                 continue;
             this._addResource(script, suppressFilterUpdate);
         }
diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js
index ce17db3..a5b6260 100644
--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js
+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js
@@ -679,7 +679,7 @@
 
     _updateDebugLockStatus()
     {
-        if (!this._style || !WI.isDebugUIEnabled() || !WI.settings.debugEnableStyleEditingDebugMode.value)
+        if (!this._style || !WI.settings.debugEnableStyleEditingDebugMode.value)
             return;
 
         this.element.classList.toggle("debug-style-locked", this._style.locked);
diff --git a/Source/WebInspectorUI/UserInterface/Views/StackTraceView.js b/Source/WebInspectorUI/UserInterface/Views/StackTraceView.js
index 2e436de..ee05ad4 100644
--- a/Source/WebInspectorUI/UserInterface/Views/StackTraceView.js
+++ b/Source/WebInspectorUI/UserInterface/Views/StackTraceView.js
@@ -35,7 +35,7 @@
         for (var callFrame of stackTrace.callFrames) {
             if (!callFrame.sourceCodeLocation && callFrame.functionName === null)
                 continue;
-            if (callFrame.isConsoleEvaluation && (!WI.isDebugUIEnabled() || !WI.settings.debugShowConsoleEvaluations.value))
+            if (callFrame.isConsoleEvaluation && !WI.settings.debugShowConsoleEvaluations.value)
                 continue;
 
             let callFrameElement = new WI.CallFrameView(callFrame, {showFunctionName: true, indicateIfBlackboxed: true});
diff --git a/Source/WebInspectorUI/UserInterface/Views/View.js b/Source/WebInspectorUI/UserInterface/Views/View.js
index 628447f..aaeccda 100644
--- a/Source/WebInspectorUI/UserInterface/Views/View.js
+++ b/Source/WebInspectorUI/UserInterface/Views/View.js
@@ -295,7 +295,7 @@
         // Ensure that the initial layout override doesn't affects to subviews.
         this._layoutReason = savedLayoutReason;
 
-        if (WI.isDebugUIEnabled() && WI.settings.debugEnableLayoutFlashing.value)
+        if (WI.settings.debugEnableLayoutFlashing.value)
             this._drawLayoutFlashingOutline(isInitialLayout);
 
         for (let view of this._subviews) {