Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: Source/WebCore/inspector/front-end/NetworkPanel.js

Issue 6409044: Merge 77127 - 2011-01-30 Pavel Feldman <pfeldman@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/inspector/front-end/DataGrid.js ('k') | Source/WebCore/inspector/front-end/networkPanel.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/NetworkPanel.js
===================================================================
--- Source/WebCore/inspector/front-end/NetworkPanel.js (revision 77243)
+++ Source/WebCore/inspector/front-end/NetworkPanel.js (working copy)
@@ -103,7 +103,7 @@
elementsToRestoreScrollPositionsFor: function()
{
- return [this.containerElement];
+ return [this.containerElement, this._dataGrid.scrollContainer];
},
resize: function()
@@ -158,6 +158,7 @@
this._dataGrid.element.style.bottom = 0;
this._sortItems();
}
+ this._updateOffscreenRows();
},
_resetSummaryBar: function()
@@ -214,6 +215,7 @@
this.containerElement.appendChild(this._dataGrid.element);
this._dataGrid.addEventListener("sorting changed", this._sortItems, this);
this._dataGrid.addEventListener("width changed", this._updateDividersIfNeeded, this);
+ this._dataGrid.scrollContainer.addEventListener("scroll", this._updateOffscreenRows.bind(this));
this._patchTimelineHeader();
},
@@ -1025,6 +1027,36 @@
{
var har = (new WebInspector.HAREntry(resource)).build();
InspectorFrontendHost.copyText(JSON.stringify(har));
+ },
+
+ _updateOffscreenRows: function(e)
+ {
+ var dataTableBody = this._dataGrid.dataTableBody;
+ var rows = dataTableBody.children;
+ var recordsCount = rows.length;
+ if (recordsCount < 2)
+ return; // Filler row only.
+
+ var visibleTop = this._dataGrid.scrollContainer.scrollTop;
+ var visibleBottom = visibleTop + this._dataGrid.scrollContainer.offsetHeight;
+
+ var rowHeight = rows[0].offsetHeight;
+
+ // Filler is at recordsCount - 1.
+ for (var i = 0; i < recordsCount - 1; ++i) {
+ var row = rows[i];
+ // Don't touch summaty - quit instead.
+ if (row === this._summaryBarRowNode)
+ break;
+ var rowIsVisible = i * rowHeight < visibleBottom && (i + 1) * rowHeight > visibleTop;
+ if (rowIsVisible !== row.rowIsVisible) {
+ if (rowIsVisible)
+ row.removeStyleClass("offscreen");
+ else
+ row.addStyleClass("offscreen");
+ row.rowIsVisible = rowIsVisible;
+ }
+ }
}
}
« no previous file with comments | « Source/WebCore/inspector/front-end/DataGrid.js ('k') | Source/WebCore/inspector/front-end/networkPanel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698