Title: [248196] trunk/Source/WebInspectorUI
Revision
248196
Author
[email protected]
Date
2019-08-03 00:37:00 -0700 (Sat, 03 Aug 2019)

Log Message

Web Inspector: Console: execution context picker doesn't update when switching to the inferred context from auto
https://bugs.webkit.org/show_bug.cgi?id=200279

Reviewed by Joseph Pecoraro.

The `representedObject` of the "auto" execution context path component is shared with that
execution context's actual path component, meaning that if the user switches from "auto" to
that execution context's path component, the underlying `representedObject` wouldn't change,
and therfore the `RuntimeManager.Event.ActiveExecutionContextChanged` wouldn't fire. In this
case, update the visible ("selected") execution context path component manually.

* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._selectExecutionContext):
(WI.QuickConsole.prototype._pathComponentSelected):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (248195 => 248196)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-08-03 04:01:35 UTC (rev 248195)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-08-03 07:37:00 UTC (rev 248196)
@@ -1,3 +1,20 @@
+2019-08-03  Devin Rousso  <[email protected]>
+
+        Web Inspector: Console: execution context picker doesn't update when switching to the inferred context from auto
+        https://bugs.webkit.org/show_bug.cgi?id=200279
+
+        Reviewed by Joseph Pecoraro.
+
+        The `representedObject` of the "auto" execution context path component is shared with that
+        execution context's actual path component, meaning that if the user switches from "auto" to
+        that execution context's path component, the underlying `representedObject` wouldn't change,
+        and therfore the `RuntimeManager.Event.ActiveExecutionContextChanged` wouldn't fire. In this
+        case, update the visible ("selected") execution context path component manually.
+
+        * UserInterface/Views/QuickConsole.js:
+        (WI.QuickConsole.prototype._selectExecutionContext):
+        (WI.QuickConsole.prototype._pathComponentSelected):
+
 2019-08-02  Devin Rousso  <[email protected]>
 
         Web Inspector: Console: all navigation items should be shown in the split console

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (248195 => 248196)


--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js	2019-08-03 04:01:35 UTC (rev 248195)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js	2019-08-03 07:37:00 UTC (rev 248196)
@@ -159,9 +159,12 @@
         if (!executionContext)
             executionContext = WI.mainTarget.executionContext;
 
-        WI.runtimeManager.activeExecutionContext = executionContext;
+        this._automaticExecutionContextPathComponent.displayName = WI.UIString("Auto - %s").format(preferredName || executionContext.name);
 
-        this._automaticExecutionContextPathComponent.displayName = WI.UIString("Auto - %s").format(preferredName || executionContext.name);
+        let changed = WI.runtimeManager.activeExecutionContext !== executionContext;
+        if (changed)
+            WI.runtimeManager.activeExecutionContext = executionContext;
+        return changed;
     }
 
     _handleMouseDown(event)
@@ -405,7 +408,11 @@
     _pathComponentSelected(event)
     {
         this._shouldAutomaticallySelectExecutionContext = event.data.pathComponent === this._automaticExecutionContextPathComponent;
-        this._selectExecutionContext(event.data.pathComponent.representedObject);
+
+        // Only manually rebuild the execution context path components if the newly selected
+        // execution context matches the previously selected one.
+        if (!this._selectExecutionContext(event.data.pathComponent.representedObject))
+            this._rebuildExecutionContextPathComponents();
     }
 
     _pathComponentClicked(event)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to