Changeset 53405 in webkit
- Timestamp:
- Jan 18, 2010 6:20:51 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53402 r53405 1 2010-01-18 Alexander Pavlov <apavlov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Improve Resources panel performance for lots of resources 6 7 DOM properties are extracted into const's, comparisons are faster. 8 https://bugs.webkit.org/show_bug.cgi?id=33790 9 10 * inspector/front-end/AbstractTimelinePanel.js: 11 (WebInspector.AbstractTimelinePanel.prototype._updateDividersLabelBarPosition): 12 * inspector/front-end/Resource.js: 13 (WebInspector.Resource.CompareByStartTime): 14 (WebInspector.Resource.CompareByResponseReceivedTime): 15 (WebInspector.Resource.CompareByEndTime): 16 (WebInspector.Resource.CompareByDuration): 17 (WebInspector.Resource.CompareByLatency): 18 (WebInspector.Resource.CompareBySize): 19 * inspector/front-end/ResourcesPanel.js: 20 (WebInspector.ResourceGraph.prototype.refreshLabelPositions): 21 1 22 2010-01-18 Daniel Bates <dbates@rim.com> 2 23 -
trunk/WebCore/inspector/front-end/AbstractTimelinePanel.js
r51296 r53405 216 216 _updateDividersLabelBarPosition: function() 217 217 { 218 var scrollTop = this.containerElement.scrollTop; 219 var dividersTop = (scrollTop < this.summaryBar.element.offsetHeight ? this.summaryBar.element.offsetHeight : scrollTop); 218 const scrollTop = this.containerElement.scrollTop; 219 const offsetHeight = this.summaryBar.element.offsetHeight; 220 const dividersTop = (scrollTop < offsetHeight ? offsetHeight : scrollTop); 220 221 this._timelineGrid.setScrollAndDividerTop(scrollTop, dividersTop); 221 222 }, -
trunk/WebCore/inspector/front-end/Resource.js
r52487 r53405 571 571 WebInspector.Resource.CompareByStartTime = function(a, b) 572 572 { 573 if (a.startTime < b.startTime) 574 return -1; 575 if (a.startTime > b.startTime) 576 return 1; 577 return 0; 573 return a.startTime - b.startTime; 578 574 } 579 575 580 576 WebInspector.Resource.CompareByResponseReceivedTime = function(a, b) 581 577 { 582 if (a.responseReceivedTime === -1 && b.responseReceivedTime !== -1) 583 return 1; 584 if (a.responseReceivedTime !== -1 && b.responseReceivedTime === -1) 585 return -1; 586 if (a.responseReceivedTime < b.responseReceivedTime) 587 return -1; 588 if (a.responseReceivedTime > b.responseReceivedTime) 589 return 1; 590 return 0; 578 var aVal = a.responseReceivedTime; 579 var bVal = b.responseReceivedTime; 580 if (aVal === -1 ^ bVal === -1) 581 return bVal - aVal; 582 return aVal - bVal; 591 583 } 592 584 593 585 WebInspector.Resource.CompareByEndTime = function(a, b) 594 586 { 595 if (a.endTime === -1 && b.endTime !== -1) 596 return 1; 597 if (a.endTime !== -1 && b.endTime === -1) 598 return -1; 599 if (a.endTime < b.endTime) 600 return -1; 601 if (a.endTime > b.endTime) 602 return 1; 603 return 0; 587 var aVal = a.endTime; 588 var bVal = b.endTime; 589 if (aVal === -1 ^ bVal === -1) 590 return bVal - aVal; 591 return aVal - bVal; 604 592 } 605 593 606 594 WebInspector.Resource.CompareByDuration = function(a, b) 607 595 { 608 if (a.duration < b.duration) 609 return -1; 610 if (a.duration > b.duration) 611 return 1; 612 return 0; 596 return a.duration - b.duration; 613 597 } 614 598 615 599 WebInspector.Resource.CompareByLatency = function(a, b) 616 600 { 617 if (a.latency < b.latency) 618 return -1; 619 if (a.latency > b.latency) 620 return 1; 621 return 0; 601 return a.latency - b.latency; 622 602 } 623 603 624 604 WebInspector.Resource.CompareBySize = function(a, b) 625 605 { 626 if (a.contentLength < b.contentLength) 627 return -1; 628 if (a.contentLength > b.contentLength) 629 return 1; 630 return 0; 606 return a.contentLength - b.contentLength; 631 607 } 632 608 -
trunk/WebCore/inspector/front-end/ResourcesPanel.js
r52547 r53405 1188 1188 1189 1189 const labelPadding = 10; 1190 const rightBarWidth = (this._barRightElement.offsetWidth - labelPadding); 1191 const leftBarWidth = ((this._barLeftElement.offsetWidth - this._barRightElement.offsetWidth) - labelPadding); 1192 1193 var labelBefore = (this._labelLeftElement.offsetWidth > leftBarWidth); 1194 var labelAfter = (this._labelRightElement.offsetWidth > rightBarWidth); 1190 const barRightElementOffsetWidth = this._barRightElement.offsetWidth; 1191 const barLeftElementOffsetWidth = this._barLeftElement.offsetWidth; 1192 const rightBarWidth = (barRightElementOffsetWidth - labelPadding); 1193 const leftBarWidth = ((barLeftElementOffsetWidth - barRightElementOffsetWidth) - labelPadding); 1194 const labelLeftElementOffsetWidth = this._labelLeftElement.offsetWidth; 1195 const labelRightElementOffsetWidth = this._labelRightElement.offsetWidth; 1196 1197 const labelBefore = (labelLeftElementOffsetWidth > leftBarWidth); 1198 const labelAfter = (labelRightElementOffsetWidth > rightBarWidth); 1199 const graphElementOffsetWidth = this._graphElement.offsetWidth; 1195 1200 1196 1201 if (labelBefore) { 1197 if (( this._graphElement.offsetWidth * (this._percentages.start / 100)) < (this._labelLeftElement.offsetWidth + 10))1202 if ((graphElementOffsetWidth * (this._percentages.start / 100)) < (labelLeftElementOffsetWidth + 10)) 1198 1203 this._labelLeftElement.addStyleClass("hidden"); 1199 1204 this._labelLeftElement.style.setProperty("right", (100 - this._percentages.start) + "%"); … … 1205 1210 1206 1211 if (labelAfter) { 1207 if (( this._graphElement.offsetWidth * ((100 - this._percentages.end) / 100)) < (this._labelRightElement.offsetWidth + 10))1212 if ((graphElementOffsetWidth * ((100 - this._percentages.end) / 100)) < (labelRightElementOffsetWidth + 10)) 1208 1213 this._labelRightElement.addStyleClass("hidden"); 1209 1214 this._labelRightElement.style.setProperty("left", this._percentages.end + "%");
Note: See TracChangeset
for help on using the changeset viewer.