Title: [261198] trunk/Source/WebInspectorUI
Revision
261198
Author
drou...@apple.com
Date
2020-05-05 14:01:27 -0700 (Tue, 05 May 2020)

Log Message

Web Inspector: the divider before the console message icons in the tab bar is shown even if there are no other icons
https://bugs.webkit.org/show_bug.cgi?id=211390

Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
(WI._updateTabBarDividers):
(WI._updateTabBarDividers.isHidden): Added.
If the various `WI.ButtonNavigationItem` aren't actually created, then the optional chain
will return `undefined` instead of the desired `true` when checking whether it is `hidden`.
Effectively, a `WI.ButtonNavigationItem` that does not exist should be considered `hidden`.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (261197 => 261198)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-05-05 21:00:52 UTC (rev 261197)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-05-05 21:01:27 UTC (rev 261198)
@@ -1,5 +1,19 @@
 2020-05-05  Devin Rousso  <drou...@apple.com>
 
+        Web Inspector: the divider before the console message icons in the tab bar is shown even if there are no other icons
+        https://bugs.webkit.org/show_bug.cgi?id=211390
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Base/Main.js:
+        (WI._updateTabBarDividers):
+        (WI._updateTabBarDividers.isHidden): Added.
+        If the various `WI.ButtonNavigationItem` aren't actually created, then the optional chain
+        will return `undefined` instead of the desired `true` when checking whether it is `hidden`.
+        Effectively, a `WI.ButtonNavigationItem` that does not exist should be considered `hidden`.
+
+2020-05-05  Devin Rousso  <drou...@apple.com>
+
         Web Inspector: Timelines: Memory: the stacked area graph should not extend beyond the "stopping time" marker
         https://bugs.webkit.org/show_bug.cgi?id=211327
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (261197 => 261198)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2020-05-05 21:00:52 UTC (rev 261197)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2020-05-05 21:01:27 UTC (rev 261198)
@@ -2415,16 +2415,20 @@
 
 WI._updateTabBarDividers = function()
 {
-    let closeHidden = WI._closeTabBarButton?.hidden;
-    let dockToSideHidden = WI._dockToSideTabBarButton?.hidden;
-    let dockBottomHidden = WI._dockBottomTabBarButton?.hidden;
-    let undockHidden = WI._undockTabBarButton?.hidden;
+    function isHidden(navigationItem) {
+        return !navigationItem || navigationItem.hidden;
+    }
 
-    let inspectModeHidden = WI._inspectModeTabBarButton.hidden;
-    let deviceSettingsHidden = WI._deviceSettingsTabBarButton && WI._deviceSettingsTabBarButton.hidden;
-    let reloadHidden = WI._reloadTabBarButton && WI._reloadTabBarButton.hidden;
-    let downloadHidden = WI._downloadTabBarButton && WI._downloadTabBarButton.hidden;
+    let closeHidden = isHidden(WI._closeTabBarButton);
+    let dockToSideHidden = isHidden(WI._dockToSideTabBarButton);
+    let dockBottomHidden = isHidden(WI._dockBottomTabBarButton);
+    let undockHidden = isHidden(WI._undockTabBarButton);
 
+    let inspectModeHidden = isHidden(WI._inspectModeTabBarButton);
+    let deviceSettingsHidden = isHidden(WI._deviceSettingsTabBarButton);
+    let reloadHidden = isHidden(WI._reloadTabBarButton);
+    let downloadHidden = isHidden(WI._downloadTabBarButton);
+
     let warningsHidden = WI._consoleWarningsTabBarButton.hidden;
     let errorsHidden = WI._consoleErrorsTabBarButton.hidden;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to