diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/inspector/front-end/NetworkPanel.js | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/inspector/front-end/NetworkPanel.js')
-rw-r--r-- | Source/WebCore/inspector/front-end/NetworkPanel.js | 95 |
1 files changed, 15 insertions, 80 deletions
diff --git a/Source/WebCore/inspector/front-end/NetworkPanel.js b/Source/WebCore/inspector/front-end/NetworkPanel.js index 085f468..06983f0 100644 --- a/Source/WebCore/inspector/front-end/NetworkPanel.js +++ b/Source/WebCore/inspector/front-end/NetworkPanel.js @@ -110,7 +110,7 @@ WebInspector.NetworkPanel.prototype = { { WebInspector.Panel.prototype.resize.call(this); this._dataGrid.updateWidths(); - this._positionSummaryBar(); + this._updateOffscreenRows(); }, updateSidebarWidth: function(width) @@ -133,41 +133,6 @@ WebInspector.NetworkPanel.prototype = { } }, - _positionSummaryBar: function() - { - // Position the total bar. - - var fillerRow = this._dataGrid.dataTableBody.lastChild; - if (this._summaryBarElement.parentElement !== this.element && fillerRow.offsetHeight > 0) { - // Glue status to bottom. - if (this._summaryBarRowNode) { - this._dataGrid.removeChild(this._summaryBarRowNode); - delete this._summaryBarRowNode; - } - this._summaryBarElement.addStyleClass("network-summary-bar-bottom"); - this.element.appendChild(this._summaryBarElement); - this._dataGrid.element.style.bottom = "20px"; - return; - } - - if (!this._summaryBarRowNode && !fillerRow.offsetHeight) { - // Glue status to table. - this._summaryBarRowNode = new WebInspector.NetworkTotalGridNode(this._summaryBarElement); - this._summaryBarElement.removeStyleClass("network-summary-bar-bottom"); - this._dataGrid.appendChild(this._summaryBarRowNode); - this._dataGrid.element.style.bottom = 0; - this._sortItems(); - } - this._updateOffscreenRows(); - }, - - _resetSummaryBar: function() - { - delete this._summaryBarRowNode; - this._summaryBarElement.parentElement.removeChild(this._summaryBarElement); - this._updateSummaryBar(); - }, - _createTimelineGrid: function() { this._timelineGrid = new WebInspector.TimelineGrid(); @@ -368,14 +333,17 @@ WebInspector.NetworkPanel.prototype = { _createSummaryBar: function() { - this._summaryBarElement = document.createElement("div"); - this._summaryBarElement.className = "network-summary-bar"; - this.containerElement.appendChild(this._summaryBarElement); + var tbody = this._dataGrid.dataTableBody; + var tfoot = document.createElement("tfoot"); + var tr = tfoot.createChild("tr", "revealed network-summary-bar"); + var td = tr.createChild("td"); + td.setAttribute("colspan", 7); + tbody.parentNode.insertBefore(tfoot, tbody); + this._summaryBarElement = td; }, _updateSummaryBar: function() { - this._positionSummaryBar(); // Grid is growing. var numRequests = this._resources.length; if (!numRequests) { @@ -387,7 +355,6 @@ WebInspector.NetworkPanel.prototype = { img.src = "Images/warningIcon.png"; this._summaryBarElement.removeChildren(); this._summaryBarElement.appendChild(img); - this._summaryBarElement.appendChild(document.createTextNode(" ")); this._summaryBarElement.appendChild(document.createTextNode( WebInspector.UIString("No requests captured. Reload the page to see detailed information on the network activity."))); return; @@ -438,7 +405,6 @@ WebInspector.NetworkPanel.prototype = { selectMultiple = true; this._filter(e.target, selectMultiple); - this._positionSummaryBar(); }, _filter: function(target, selectMultiple) @@ -478,6 +444,7 @@ WebInspector.NetworkPanel.prototype = { target.addStyleClass("selected"); this._showCategory(target.category); + this._updateOffscreenRows(); return; } @@ -655,7 +622,6 @@ WebInspector.NetworkPanel.prototype = { this.visibleView.show(this._viewsContainerElement); this._dataGrid.updateWidths(); - this._positionSummaryBar(); }, hide: function() @@ -727,6 +693,7 @@ WebInspector.NetworkPanel.prototype = { this._staleResources = []; this._sortItems(); this._updateSummaryBar(); + this._updateOffscreenRows(); this._dataGrid.updateWidths(); if (wasScrolledToLastRow) @@ -756,7 +723,6 @@ WebInspector.NetworkPanel.prototype = { this._resourceGridNodes = {}; this._dataGrid.removeChildren(); - delete this._summaryBarRowNode; this._updateDividersIfNeeded(true); // End reset timeline. @@ -765,7 +731,8 @@ WebInspector.NetworkPanel.prototype = { this._viewsContainerElement.removeChildren(); this._viewsContainerElement.appendChild(this._closeButtonElement); - this._resetSummaryBar(); + this._updateSummaryBar(); + WebInspector.extensionServer.resetResources(); }, get resources() @@ -904,7 +871,7 @@ WebInspector.NetworkPanel.prototype = { this._timelineGrid.element.removeStyleClass("small"); this._viewsContainerElement.removeStyleClass("small"); } - this._positionSummaryBar(); + this._updateOffscreenRows(); }, _getPopoverAnchor: function(element) @@ -1006,7 +973,7 @@ WebInspector.NetworkPanel.prototype = { _contextMenu: function(event) { // createBlobURL is enabled conditionally, do not expose resource export if it's not available. - if (typeof window.webkitURL.createObjectURL !== "function" || !Preferences.resourceExportEnabled) + if ((window.webkitURL && typeof window.webkitURL.createObjectURL !== "function") || !Preferences.resourceExportEnabled) return; var contextMenu = new WebInspector.ContextMenu(); @@ -1049,9 +1016,6 @@ WebInspector.NetworkPanel.prototype = { var unfilteredRowIndex = 0; for (var i = 0; i < recordsCount - 1; ++i) { var row = rows[i]; - // Don't touch summaty - quit instead. - if (this._summaryBarRowNode && row === this._summaryBarRowNode.element) - break; var dataGridNode = this._dataGrid.dataGridNodeFromNode(row); if (dataGridNode.isFilteredOut()) { @@ -1395,7 +1359,7 @@ WebInspector.NetworkDataGridNode.prototype = { _openInNewTab: function() { - InspectorBackend.openInInspectedWindow(this._resource.url); + InspectorAgent.openInInspectedWindow(this._resource.url); }, get selectable() @@ -1711,32 +1675,3 @@ WebInspector.NetworkDataGridNode.ResourcePropertyComparator = function(propertyN } WebInspector.NetworkDataGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype; - -WebInspector.NetworkTotalGridNode = function(element) -{ - this._summaryBarElement = element; - WebInspector.DataGridNode.call(this, {summaryRow: true}); -} - -WebInspector.NetworkTotalGridNode.prototype = { - isFilteredOut: function() - { - return false; - }, - - get selectable() - { - return false; - }, - - createCells: function() - { - var td = document.createElement("td"); - td.setAttribute("colspan", 7); - td.className = "network-summary"; - td.appendChild(this._summaryBarElement); - this._element.appendChild(td); - } -} - -WebInspector.NetworkTotalGridNode.prototype.__proto__ = WebInspector.DataGridNode.prototype; |