Web Inspector: Console: add a setting for controlling auto-expansion of Trace messages
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2019 18:58:04 +0000 (18:58 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2019 18:58:04 +0000 (18:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195690

Reviewed by Timothy Hatcher.

* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendStackTrace):

* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):

* Localizations/en.lproj/localizedStrings.js:

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Base/Setting.js
Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js

index ffc648c..6a90263 100644 (file)
@@ -1,5 +1,21 @@
 2019-03-20  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: Console: add a setting for controlling auto-expansion of Trace messages
+        https://bugs.webkit.org/show_bug.cgi?id=195690
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/ConsoleMessageView.js:
+        (WI.ConsoleMessageView.prototype._appendStackTrace):
+
+        * UserInterface/Base/Setting.js:
+        * UserInterface/Views/SettingsTabContentView.js:
+        (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
+
+        * Localizations/en.lproj/localizedStrings.js:
+
+2019-03-20  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: DOM: selecting a node in a different frame should automatically switch the console prompt's execution context
         https://bugs.webkit.org/show_bug.cgi?id=195805
         <rdar://problem/48930866>
index 900e80d..1ab67e2 100644 (file)
@@ -145,6 +145,7 @@ localizedStrings["Author Stylesheet"] = "Author Stylesheet";
 localizedStrings["Auto"] = "Auto";
 localizedStrings["Auto - %s"] = "Auto - %s";
 localizedStrings["Auto Increment"] = "Auto Increment";
+localizedStrings["Auto-expand Traces"] = "Auto-expand Traces";
 localizedStrings["Automatically continue after evaluating"] = "Automatically continue after evaluating";
 localizedStrings["Available Style Sheets"] = "Available Style Sheets";
 localizedStrings["Average CPU: %s"] = "Average CPU: %s";
@@ -263,6 +264,7 @@ localizedStrings["Console Evaluation %d"] = "Console Evaluation %d";
 localizedStrings["Console Profile Recorded"] = "Console Profile Recorded";
 localizedStrings["Console cleared at %s"] = "Console cleared at %s";
 localizedStrings["Console opened at %s"] = "Console opened at %s";
+localizedStrings["Console:"] = "Console:";
 localizedStrings["Containing"] = "Containing";
 localizedStrings["Content"] = "Content";
 localizedStrings["Content Security Policy violation of directive: %s"] = "Content Security Policy violation of directive: %s";
index 4d54ee4..21e65e6 100644 (file)
@@ -127,6 +127,7 @@ WI.Setting.Event = {
 WI.settings = {
     canvasRecordingAutoCaptureEnabled: new WI.Setting("canvas-recording-auto-capture-enabled", false),
     canvasRecordingAutoCaptureFrameCount: new WI.Setting("canvas-recording-auto-capture-frame-count", 1),
+    consoleAutoExpandTrace: new WI.Setting("console-auto-expand-trace", true),
     cssChangesPerNode: new WI.Setting("css-changes-per-node", false),
     clearLogOnNavigate: new WI.Setting("clear-log-on-navigate", true),
     clearNetworkOnNavigate: new WI.Setting("clear-network-on-navigate", true),
index a6c23c6..2503d97 100644 (file)
@@ -416,8 +416,7 @@ WI.ConsoleMessageView = class ConsoleMessageView extends WI.Object
 
         this._makeExpandable();
 
-        // Auto-expand for console.trace.
-        if (this._message.type === WI.ConsoleMessage.MessageType.Trace)
+        if (this._message.type === WI.ConsoleMessage.MessageType.Trace && WI.settings.consoleAutoExpandTrace.value)
             this.expand();
 
         this._stackTraceElement = this._element.appendChild(document.createElement("div"));
index 8032b62..08066cd 100644 (file)
@@ -208,6 +208,7 @@ WI.SettingsTabContentView = class SettingsTabContentView extends WI.TabContentVi
 
         generalSettingsView.addSetting(WI.UIString("Debugger:"), WI.settings.showScopeChainOnPause, WI.UIString("Show Scope Chain on pause"));
         generalSettingsView.addSetting(WI.UIString("Source maps:"), WI.settings.sourceMapsEnabled, WI.UIString("Enable source maps"));
+        generalSettingsView.addSetting(WI.UIString("Console:"), WI.settings.consoleAutoExpandTrace, WI.UIString("Auto-expand Traces"));
 
         generalSettingsView.addSeparator();