Changeset 240347 in webkit


Ignore:
Timestamp:
Jan 23, 2019 10:46:56 AM (5 years ago)
Author:
commit-queue@webkit.org
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 <Joseph Pecoraro> 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.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r240323 r240347  
     12019-01-23  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Network Waterfall column should redraw when adding/removing new columns
     4        https://bugs.webkit.org/show_bug.cgi?id=193696
     5        <rdar://problem/47464149>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * UserInterface/Views/TableColumn.js:
     10        (WI.TableColumn.prototype.get needsReloadOnResize):
     11        * UserInterface/Views/NetworkTableContentView.js:
     12        (WI.NetworkTableContentView.prototype.initialLayout):
     13        Mark the waterfall column as sensitive to any resizes.
     14
     15        * UserInterface/Views/Table.js:
     16        (WI.Table.prototype.showColumn):
     17        (WI.Table.prototype.hideColumn):
     18        Update column widths and reload any columns that may be sensitive to resizes.
     19
    1202019-01-22  Devin Rousso  <drousso@apple.com>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js

    r240173 r240347  
    10711071            minWidth: 230,
    10721072            headerView: this._waterfallTimelineRuler,
     1073            needsReloadOnResize: true,
    10731074        });
    10741075
  • trunk/Source/WebInspectorUI/UserInterface/Views/Table.js

    r240290 r240347  
    484484
    485485        // Re-layout all columns to make space.
     486        this._widthGeneration++;
    486487        this._columnWidths = null;
    487488        this._resizeColumnsAndFiller();
     
    490491        for (let cell of cellsToPopulate)
    491492            this._delegate.tablePopulateCell(this, cell, column, cell.parentElement.__index);
     493
     494        // Now populate columns that may be sensitive to resizes.
     495        for (let visibleColumn of this._visibleColumns) {
     496            if (visibleColumn !== column) {
     497                if (visibleColumn.needsReloadOnResize)
     498                    this.reloadVisibleColumnCells(visibleColumn);
     499            }
     500        }
    492501    }
    493502
     
    534543            return;
    535544
    536         this._columnWidths.splice(columnIndex, 1);
    537 
    538545        for (let row of this._listElement.children) {
    539546            if (row !== this._fillerRow)
     
    541548        }
    542549
    543         this.needsLayout();
     550        // Re-layout all columns to make space.
     551        this._widthGeneration++;
     552        this._columnWidths = null;
     553        this._resizeColumnsAndFiller();
     554
     555        // Now populate columns that may be sensitive to resizes.
     556        for (let visibleColumn of this._visibleColumns) {
     557            if (visibleColumn.needsReloadOnResize)
     558                this.reloadVisibleColumnCells(visibleColumn);
     559        }
    544560    }
    545561
  • trunk/Source/WebInspectorUI/UserInterface/Views/TableColumn.js

    r223734 r240347  
    2626WI.TableColumn = class TableColumn extends WI.Object
    2727{
    28     constructor(identifier, name, {initialWidth, minWidth, maxWidth, hidden, sortable, hideable, align, resizeType, headerView} = {})
     28    constructor(identifier, name, {initialWidth, minWidth, maxWidth, hidden, sortable, hideable, align, resizeType, headerView, needsReloadOnResize} = {})
    2929    {
    3030        super();
     
    5050        this._resizeType = resizeType || TableColumn.ResizeType.Auto;
    5151        this._headerView = headerView || null;
     52        this._needsReloadOnResize = needsReloadOnResize || false;
    5253
    5354        console.assert(!this._minWidth || !this._maxWidth || this._minWidth <= this._maxWidth, "Invalid min/max", this._minWidth, this._maxWidth);
     
    6869    get align() { return this._align; }
    6970    get headerView() { return this._headerView; }
     71    get needsReloadOnResize() { return this._needsReloadOnResize; }
    7072
    7173    get locked() { return this._resizeType === TableColumn.ResizeType.Locked; }
Note: See TracChangeset for help on using the changeset viewer.