https://bugs.webkit.org/show_bug.cgi?id=193696
<rdar://problem/
47464149>
Patch by Joseph Pecoraro <pecoraro@apple.com> 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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240347
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2019-01-23 Joseph Pecoraro <pecoraro@apple.com>
+
+ 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 <drousso@apple.com>
Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
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);
}
// Re-layout all columns to make space.
+ this._widthGeneration++;
this._columnWidths = null;
this._resizeColumnsAndFiller();
// 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)
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()
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();
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);
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; }