Title: [240347] trunk/Source/WebInspectorUI
Revision
240347
Author
[email protected]
Date
2019-01-23 10:46:56 -0800 (Wed, 23 Jan 2019)

Log Message

Web Inspector: Network Waterfall column should redraw when adding/removing new columns
https://bugs.webkit.org/show_bug.cgi?id=193696
<rdar://problem/47464149>

Patch by Joseph Pecoraro <[email protected]> on 2019-01-23
Reviewed by Devin Rousso.

* UserInterface/Views/TableColumn.js:
(WI.TableColumn.prototype.get needsReloadOnResize):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.initialLayout):
Mark the waterfall column as sensitive to any resizes.

* UserInterface/Views/Table.js:
(WI.Table.prototype.showColumn):
(WI.Table.prototype.hideColumn):
Update column widths and reload any columns that may be sensitive to resizes.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (240346 => 240347)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-01-23 18:44:34 UTC (rev 240346)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-01-23 18:46:56 UTC (rev 240347)
@@ -1,3 +1,22 @@
+2019-01-23  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Network Waterfall column should redraw when adding/removing new columns
+        https://bugs.webkit.org/show_bug.cgi?id=193696
+        <rdar://problem/47464149>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/TableColumn.js:
+        (WI.TableColumn.prototype.get needsReloadOnResize):
+        * UserInterface/Views/NetworkTableContentView.js:
+        (WI.NetworkTableContentView.prototype.initialLayout):
+        Mark the waterfall column as sensitive to any resizes.
+
+        * UserInterface/Views/Table.js:
+        (WI.Table.prototype.showColumn):
+        (WI.Table.prototype.hideColumn):
+        Update column widths and reload any columns that may be sensitive to resizes.
+
 2019-01-22  Devin Rousso  <[email protected]>
 
         Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js (240346 => 240347)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js	2019-01-23 18:44:34 UTC (rev 240346)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js	2019-01-23 18:46:56 UTC (rev 240347)
@@ -1070,6 +1070,7 @@
         this._waterfallColumn = new WI.TableColumn("waterfall", WI.UIString("Waterfall"), {
             minWidth: 230,
             headerView: this._waterfallTimelineRuler,
+            needsReloadOnResize: true,
         });
 
         this._nameColumn.addEventListener(WI.TableColumn.Event.WidthDidChange, this._tableNameColumnDidChangeWidth, this);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/Table.js (240346 => 240347)


--- trunk/Source/WebInspectorUI/UserInterface/Views/Table.js	2019-01-23 18:44:34 UTC (rev 240346)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Table.js	2019-01-23 18:46:56 UTC (rev 240347)
@@ -483,6 +483,7 @@
         }
 
         // Re-layout all columns to make space.
+        this._widthGeneration++;
         this._columnWidths = null;
         this._resizeColumnsAndFiller();
 
@@ -489,6 +490,14 @@
         // Now populate only the new cells for this column.
         for (let cell of cellsToPopulate)
             this._delegate.tablePopulateCell(this, cell, column, cell.parentElement.__index);
+
+        // Now populate columns that may be sensitive to resizes.
+        for (let visibleColumn of this._visibleColumns) {
+            if (visibleColumn !== column) {
+                if (visibleColumn.needsReloadOnResize)
+                    this.reloadVisibleColumnCells(visibleColumn);
+            }
+        }
     }
 
     hideColumn(column)
@@ -533,14 +542,21 @@
         if (!this._columnWidths)
             return;
 
-        this._columnWidths.splice(columnIndex, 1);
-
         for (let row of this._listElement.children) {
             if (row !== this._fillerRow)
                 row.removeChild(row.children[columnIndex]);
         }
 
-        this.needsLayout();
+        // Re-layout all columns to make space.
+        this._widthGeneration++;
+        this._columnWidths = null;
+        this._resizeColumnsAndFiller();
+
+        // Now populate columns that may be sensitive to resizes.
+        for (let visibleColumn of this._visibleColumns) {
+            if (visibleColumn.needsReloadOnResize)
+                this.reloadVisibleColumnCells(visibleColumn);
+        }
     }
 
     restoreScrollPosition()

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TableColumn.js (240346 => 240347)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TableColumn.js	2019-01-23 18:44:34 UTC (rev 240346)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TableColumn.js	2019-01-23 18:46:56 UTC (rev 240347)
@@ -25,7 +25,7 @@
 
 WI.TableColumn = class TableColumn extends WI.Object
 {
-    constructor(identifier, name, {initialWidth, minWidth, maxWidth, hidden, sortable, hideable, align, resizeType, headerView} = {})
+    constructor(identifier, name, {initialWidth, minWidth, maxWidth, hidden, sortable, hideable, align, resizeType, headerView, needsReloadOnResize} = {})
     {
         super();
 
@@ -49,6 +49,7 @@
         this._align = align || null;
         this._resizeType = resizeType || TableColumn.ResizeType.Auto;
         this._headerView = headerView || null;
+        this._needsReloadOnResize = needsReloadOnResize || false;
 
         console.assert(!this._minWidth || !this._maxWidth || this._minWidth <= this._maxWidth, "Invalid min/max", this._minWidth, this._maxWidth);
         console.assert(isNaN(this._width) || !this._minWidth || (this._width >= this._minWidth), "Initial width is less than min", this._width, this._minWidth);
@@ -67,6 +68,7 @@
     get hideable() { return this._hideable; }
     get align() { return this._align; }
     get headerView() { return this._headerView; }
+    get needsReloadOnResize() { return this._needsReloadOnResize; }
 
     get locked() { return this._resizeType === TableColumn.ResizeType.Locked; }
     get flexible() { return this._resizeType === TableColumn.ResizeType.Auto; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to