Title: [282616] trunk/Source/WebInspectorUI
Revision
282616
Author
pan...@apple.com
Date
2021-09-16 16:05:55 -0700 (Thu, 16 Sep 2021)

Log Message

Web Inspector: Regression(r279613) Audit result scope toggles are missing
https://bugs.webkit.org/show_bug.cgi?id=230322

Reviewed by Devin Rousso.

The sizing calculations modified in r279613 were erroneously applied to both the minimum space calculation as
well as the navigation item hiding calculations, despite hiding navigation items never being done for non-sidebar
navigation bars. The logic in `WI.NavigationBar.prototype._calculateMinimumWidth` remains unchanged, as we still
need sidebars to provide a minimum width that can accommodate all items in a flex layout in order to avoid
flowing navigation items on to another row. The navigation bar in a sidebar is unique in this respect, as other
navigation bars will gracefully hide components if they truly don't have enough space, but a sidebar relies on
getting a minimum size that can actually accommodate all items in a single row.

* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth):
(WI.NavigationBar.prototype.layout):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (282615 => 282616)


--- trunk/Source/WebInspectorUI/ChangeLog	2021-09-16 23:05:14 UTC (rev 282615)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-09-16 23:05:55 UTC (rev 282616)
@@ -1,5 +1,24 @@
 2021-09-16  Patrick Angle  <pan...@apple.com>
 
+        Web Inspector: Regression(r279613) Audit result scope toggles are missing
+        https://bugs.webkit.org/show_bug.cgi?id=230322
+
+        Reviewed by Devin Rousso.
+
+        The sizing calculations modified in r279613 were erroneously applied to both the minimum space calculation as
+        well as the navigation item hiding calculations, despite hiding navigation items never being done for non-sidebar
+        navigation bars. The logic in `WI.NavigationBar.prototype._calculateMinimumWidth` remains unchanged, as we still
+        need sidebars to provide a minimum width that can accommodate all items in a flex layout in order to avoid
+        flowing navigation items on to another row. The navigation bar in a sidebar is unique in this respect, as other
+        navigation bars will gracefully hide components if they truly don't have enough space, but a sidebar relies on
+        getting a minimum size that can actually accommodate all items in a single row.
+
+        * UserInterface/Views/NavigationBar.js:
+        (WI.NavigationBar.prototype.layout.calculateVisibleItemWidth):
+        (WI.NavigationBar.prototype.layout):
+
+2021-09-16  Patrick Angle  <pan...@apple.com>
+
         Web Inspector: Don't maintain a back-forward stack for `ContentBrowser`/`ContentViewContainer` when not necessary
         https://bugs.webkit.org/show_bug.cgi?id=230286
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js (282615 => 282616)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js	2021-09-16 23:05:14 UTC (rev 282615)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js	2021-09-16 23:05:55 UTC (rev 282616)
@@ -223,7 +223,7 @@
         let visibleNavigationItems = this._visibleNavigationItems;
 
         function calculateVisibleItemWidth() {
-            return visibleNavigationItems.reduce((total, item) => total + Math.ceil(item.width), 0);
+            return visibleNavigationItems.reduce((total, item) => total + item.width, 0);
         }
 
         let totalItemWidth = calculateVisibleItemWidth();
@@ -252,7 +252,7 @@
 
             while (totalItemWidth > barWidth && visibleNavigationItems.length) {
                 let navigationItem = visibleNavigationItems.shift();
-                totalItemWidth -= Math.ceil(navigationItem.width);
+                totalItemWidth -= navigationItem.width;
                 forceItemHidden(navigationItem, true);
             }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to