Title: [252745] trunk/Source/WebInspectorUI
Revision
252745
Author
[email protected]
Date
2019-11-21 12:06:20 -0800 (Thu, 21 Nov 2019)

Log Message

Web Inspector: call frames from blackboxed scripts should be visually distinct
https://bugs.webkit.org/show_bug.cgi?id=204424

Reviewed by Timothy Hatcher.

Seeing "Deferred pause from blackboxed script" in the Pause Reason does indicate that
something in the Call Stack was blackboxed, but it doesn't clarify what was blackboxed.

Given that the debugger effectively ignores blackboxed scripts, we should distinguish call
frames that were ignored so that it's clear how the current pause location was reached.

* UserInterface/Views/CallFrameTreeElement.js:
(WI.CallFrameTreeElement):
(WI.CallFrameTreeElement.prototype.onattach):
* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame.blackboxed:not(.selected)): Added.
Make blackboxed call frames 50% opaque when not selected. Add additional explanatory text to
the end of the tooltip when hovering blackboxed call frame tree elements.

* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState):
Update tooltip/contextmenu text to include "blacboxing" so functionality is clearer.

* UserInterface/Models/SourceCodeLocation.js:
(WI.SourceCodeLocation.prototype.populateLiveDisplayLocationTooltip):
Allow a suffix to be added to the end of the live location.

* Localizations/en.lproj/localizedStrings.js:

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (252744 => 252745)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-11-21 19:53:41 UTC (rev 252744)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-11-21 20:06:20 UTC (rev 252745)
@@ -1,3 +1,36 @@
+2019-11-21  Devin Rousso  <[email protected]>
+
+        Web Inspector: call frames from blackboxed scripts should be visually distinct
+        https://bugs.webkit.org/show_bug.cgi?id=204424
+
+        Reviewed by Timothy Hatcher.
+
+        Seeing "Deferred pause from blackboxed script" in the Pause Reason does indicate that
+        something in the Call Stack was blackboxed, but it doesn't clarify what was blackboxed.
+
+        Given that the debugger effectively ignores blackboxed scripts, we should distinguish call
+        frames that were ignored so that it's clear how the current pause location was reached.
+
+        * UserInterface/Views/CallFrameTreeElement.js:
+        (WI.CallFrameTreeElement):
+        (WI.CallFrameTreeElement.prototype.onattach):
+        * UserInterface/Views/CallFrameTreeElement.css:
+        (.tree-outline .item.call-frame.blackboxed:not(.selected)): Added.
+        Make blackboxed call frames 50% opaque when not selected. Add additional explanatory text to
+        the end of the tooltip when hovering blackboxed call frame tree elements.
+
+        * UserInterface/Views/ContextMenuUtilities.js:
+        (WI.appendContextMenuItemsForSourceCode):
+        * UserInterface/Views/SourceCodeTreeElement.js:
+        (WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState):
+        Update tooltip/contextmenu text to include "blacboxing" so functionality is clearer.
+
+        * UserInterface/Models/SourceCodeLocation.js:
+        (WI.SourceCodeLocation.prototype.populateLiveDisplayLocationTooltip):
+        Allow a suffix to be added to the end of the live location.
+
+        * Localizations/en.lproj/localizedStrings.js:
+
 2019-11-20  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: REGRESSION(r250618): main resource view is empty when pausing on inline 'debugger' statement

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (252744 => 252745)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2019-11-21 19:53:41 UTC (rev 252744)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2019-11-21 20:06:20 UTC (rev 252745)
@@ -175,6 +175,7 @@
 localizedStrings["Binary Frame"] = "Binary Frame";
 localizedStrings["Binding"] = "Binding";
 localizedStrings["Blackbox"] = "Blackbox";
+localizedStrings["Blackbox script to ignore it when debugging"] = "Blackbox script to ignore it when debugging";
 localizedStrings["Block Variables"] = "Block Variables";
 localizedStrings["Body:"] = "Body:";
 localizedStrings["Boundary"] = "Boundary";
@@ -620,7 +621,6 @@
 localizedStrings["Imported"] = "Imported";
 localizedStrings["Imported - %s"] = "Imported - %s";
 localizedStrings["Imported \u2014 %s"] = "Imported \u2014 %s";
-localizedStrings["Include script when debugging"] = "Include script when debugging";
 localizedStrings["Incomplete"] = "Incomplete";
 localizedStrings["Indent width:"] = "Indent width:";
 localizedStrings["Index"] = "Index";
@@ -991,7 +991,8 @@
 localizedStrings["Script Element %d"] = "Script Element %d";
 localizedStrings["Script Entries:"] = "Script Entries:";
 localizedStrings["Script Evaluated"] = "Script Evaluated";
-localizedStrings["Script ignored when debugging due to previously set blackbox URL pattern"] = "Script ignored when debugging due to previously set blackbox URL pattern";
+localizedStrings["Script ignored due to blackbox"] = "Script ignored due to blackbox";
+localizedStrings["Script ignored when debugging due to URL pattern blackbox"] = "Script ignored when debugging due to URL pattern blackbox";
 localizedStrings["Scripts"] = "Scripts";
 localizedStrings["Scripts can also be individually blackboxed by clicking on the %s icon that is shown on hover."] = "Scripts can also be individually blackboxed by clicking on the %s icon that is shown on hover.";
 /* Scroll selected DOM node into view on the inspected web page */
@@ -1235,6 +1236,7 @@
 localizedStrings["URL Pattern"] = "URL Pattern";
 localizedStrings["Unable to determine path to property from root"] = "Unable to determine path to property from root";
 localizedStrings["Unable to show certificate for \u201C%s\u201D"] = "Unable to show certificate for \u201C%s\u201D";
+localizedStrings["Unblackbox script to include it when debugging"] = "Unblackbox script to include it when debugging";
 /* Break (pause) on uncaught (unhandled) exceptions */
 localizedStrings["Uncaught Exceptions"] = "Uncaught Exceptions";
 localizedStrings["Undefined custom element"] = "Undefined custom element";

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js (252744 => 252745)


--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js	2019-11-21 19:53:41 UTC (rev 252744)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js	2019-11-21 20:06:20 UTC (rev 252745)
@@ -197,15 +197,16 @@
         });
     }
 
-    populateLiveDisplayLocationTooltip(element, prefix)
+    populateLiveDisplayLocationTooltip(element, prefix, suffix)
     {
         prefix = prefix || "";
+        suffix = suffix || "";
 
-        element.title = prefix + this.tooltipString();
+        element.title = prefix + this.tooltipString() + suffix;
 
         this.addEventListener(WI.SourceCodeLocation.Event.DisplayLocationChanged, function(event) {
             if (this.sourceCode)
-                element.title = prefix + this.tooltipString();
+                element.title = prefix + this.tooltipString() + suffix;
         }, this);
     }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.css (252744 => 252745)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.css	2019-11-21 19:53:41 UTC (rev 252744)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.css	2019-11-21 20:06:20 UTC (rev 252745)
@@ -102,3 +102,7 @@
 .tree-outline.single-thread .item.call-frame.async-boundary::before {
     width: 20px;
 }
+
+.tree-outline .item.call-frame.blackboxed:not(.selected) {
+    opacity: 0.5;
+}

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js (252744 => 252745)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js	2019-11-21 19:53:41 UTC (rev 252744)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CallFrameTreeElement.js	2019-11-21 20:06:20 UTC (rev 252745)
@@ -55,6 +55,12 @@
             // Set the tooltip on the entire tree element in onattach, once the element is created.
             this.tooltipHandledSeparately = true;
         }
+
+        this._isBlackboxed = WI.debuggerManager.blackboxDataForSourceCode(this._callFrame.sourceCodeLocation.sourceCode);
+        if (this._isBlackboxed) {
+            this.addClassName("blackboxed");
+            this.tooltipHandledSeparately = true;
+        }
     }
 
     // Public
@@ -84,7 +90,12 @@
             if (this._callFrame.isTailDeleted)
                 tailCallSuffix = " " + WI.UIString("(Tail Call)");
             let tooltipPrefix = this.mainTitle + tailCallSuffix + "\n";
-            this._callFrame.sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element, tooltipPrefix);
+
+            let tooltipSuffix = "";
+            if (this._isBlackboxed)
+                tooltipSuffix += "\n\n" + WI.UIString("Script ignored due to blackbox");
+
+            this._callFrame.sourceCodeLocation.populateLiveDisplayLocationTooltip(this.element, tooltipPrefix, tooltipSuffix);
         }
 
         this._updateStatus();

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js (252744 => 252745)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js	2019-11-21 19:53:41 UTC (rev 252744)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js	2019-11-21 20:06:20 UTC (rev 252745)
@@ -101,7 +101,7 @@
                 });
             });
         } else {
-            contextMenu.appendItem(blackboxData ? WI.UIString("Include script when debugging") : WI.UIString("Ignore script when debugging"), () => {
+            contextMenu.appendItem(blackboxData ? WI.UIString("Unblackbox script to include it when debugging") : WI.UIString("Blackbox script to ignore it when debugging"), () => {
                 WI.debuggerManager.setShouldBlackboxScript(sourceCode, !blackboxData);
             });
         }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js (252744 => 252745)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js	2019-11-21 19:53:41 UTC (rev 252744)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js	2019-11-21 20:06:20 UTC (rev 252745)
@@ -217,17 +217,17 @@
         if (blackboxData) {
             switch (blackboxData.type) {
             case WI.DebuggerManager.BlackboxType.Pattern:
-                this._toggleBlackboxedImageElement.title = WI.UIString("Script ignored when debugging due to previously set blackbox URL pattern");
+                this._toggleBlackboxedImageElement.title = WI.UIString("Script ignored when debugging due to URL pattern blackbox");
                 break;
 
             case WI.DebuggerManager.BlackboxType.URL:
-                this._toggleBlackboxedImageElement.title = WI.UIString("Include script when debugging");
+                this._toggleBlackboxedImageElement.title = WI.UIString("Unblackbox script to include it when debugging");
                 break;
             }
 
             console.assert(this._toggleBlackboxedImageElement.title);
         } else
-            this._toggleBlackboxedImageElement.title = WI.UIString("Ignore script when debugging");
+            this._toggleBlackboxedImageElement.title = WI.UIString("Blackbox script to ignore it when debugging");
     }
 
     _handleToggleBlackboxedImageElementClicked(event)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to