Changeset 77127 in webkit


Ignore:
Timestamp:
Jan 31, 2011 6:43:18 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-01-30 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: speed up network panel rendering.
https://bugs.webkit.org/show_bug.cgi?id=53397

  • inspector/front-end/DataGrid.js: (WebInspector.DataGrid.prototype.get scrollContainer):
  • inspector/front-end/NetworkPanel.js: (WebInspector.NetworkPanel.prototype.elementsToRestoreScrollPositionsFor): (WebInspector.NetworkPanel.prototype._positionSummaryBar): (WebInspector.NetworkPanel.prototype._createTable): (WebInspector.NetworkPanel.prototype._exportResource): (WebInspector.NetworkPanel.prototype._onScroll):
  • inspector/front-end/networkPanel.css: (.network-sidebar .data-grid.small tr.offscreen): (.network-sidebar .data-grid tr.offscreen): (.network-sidebar .data-grid tr.offscreen td):
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r77126 r77127  
     12011-01-30  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: speed up network panel rendering.
     6        https://bugs.webkit.org/show_bug.cgi?id=53397
     7
     8        * inspector/front-end/DataGrid.js:
     9        (WebInspector.DataGrid.prototype.get scrollContainer):
     10        * inspector/front-end/NetworkPanel.js:
     11        (WebInspector.NetworkPanel.prototype.elementsToRestoreScrollPositionsFor):
     12        (WebInspector.NetworkPanel.prototype._positionSummaryBar):
     13        (WebInspector.NetworkPanel.prototype._createTable):
     14        (WebInspector.NetworkPanel.prototype._exportResource):
     15        (WebInspector.NetworkPanel.prototype._onScroll):
     16        * inspector/front-end/networkPanel.css:
     17        (.network-sidebar .data-grid.small tr.offscreen):
     18        (.network-sidebar .data-grid tr.offscreen):
     19        (.network-sidebar .data-grid tr.offscreen td):
     20
    1212011-01-31  Peter Varga  <pvarga@webkit.org>
    222
  • trunk/Source/WebCore/inspector/front-end/DataGrid.js

    r74193 r77127  
    492492
    493493        this._columnWidthsInitialized = false;
     494    },
     495
     496    get scrollContainer()
     497    {
     498        return this._scrollContainer;       
    494499    },
    495500
  • trunk/Source/WebCore/inspector/front-end/NetworkPanel.js

    r76483 r77127  
    104104    elementsToRestoreScrollPositionsFor: function()
    105105    {
    106         return [this.containerElement];
     106        return [this.containerElement, this._dataGrid.scrollContainer];
    107107    },
    108108
     
    159159            this._sortItems();
    160160        }
     161        this._updateOffscreenRows();
    161162    },
    162163
     
    215216        this._dataGrid.addEventListener("sorting changed", this._sortItems, this);
    216217        this._dataGrid.addEventListener("width changed", this._updateDividersIfNeeded, this);
     218        this._dataGrid.scrollContainer.addEventListener("scroll", this._updateOffscreenRows.bind(this));
    217219
    218220        this._patchTimelineHeader();
     
    10261028        var har = (new WebInspector.HAREntry(resource)).build();
    10271029        offerFileForDownload(JSON.stringify(har));
     1030    },
     1031
     1032    _updateOffscreenRows: function(e)
     1033    {
     1034        var dataTableBody = this._dataGrid.dataTableBody;
     1035        var rows = dataTableBody.children;
     1036        var recordsCount = rows.length;
     1037        if (recordsCount < 2)
     1038            return;  // Filler row only.
     1039
     1040        var visibleTop = this._dataGrid.scrollContainer.scrollTop;
     1041        var visibleBottom = visibleTop + this._dataGrid.scrollContainer.offsetHeight;
     1042
     1043        var rowHeight = rows[0].offsetHeight;
     1044
     1045        // Filler is at recordsCount - 1.
     1046        for (var i = 0; i < recordsCount - 1; ++i) {
     1047            var row = rows[i];
     1048            // Don't touch summaty - quit instead.
     1049            if (row === this._summaryBarRowNode)
     1050                break;
     1051            var rowIsVisible = i * rowHeight < visibleBottom && (i + 1) * rowHeight > visibleTop;
     1052            if (rowIsVisible !== row.rowIsVisible) {
     1053                if (rowIsVisible)
     1054                    row.removeStyleClass("offscreen");
     1055                else
     1056                    row.addStyleClass("offscreen");
     1057                row.rowIsVisible = rowIsVisible;
     1058            }
     1059        }
    10281060    }
    10291061}
  • trunk/Source/WebCore/inspector/front-end/networkPanel.css

    r73145 r77127  
    6464    font-size: 11px;
    6565    font-weight: bold;
     66}
     67
     68.network-sidebar .data-grid.small tr.offscreen {
     69    height: 21px;
     70}
     71
     72.network-sidebar .data-grid tr.offscreen {
     73    height: 41px;
     74}
     75
     76.network-sidebar .data-grid tr.offscreen td {
     77    display: none;
    6678}
    6779
Note: See TracChangeset for help on using the changeset viewer.