Changeset 56772 in webkit
- Timestamp:
- Mar 30, 2010 1:59:20 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r56770 r56772 1 2010-03-30 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Visible/captured records counter should be implemented in Timeline panel. 6 https://bugs.webkit.org/show_bug.cgi?id=36708 7 8 * English.lproj/localizedStrings.js: 9 * inspector/front-end/TimelinePanel.js: 10 (WebInspector.TimelinePanel.prototype.get statusBarItems): 11 (WebInspector.TimelinePanel.prototype._createStatusbarButtons): 12 (WebInspector.TimelinePanel.prototype._updateRecordsCounter): 13 (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline): 14 (WebInspector.TimelinePanel.prototype._createRootRecord): 15 (WebInspector.TimelinePanel.prototype._refresh): 16 (WebInspector.TimelinePanel.prototype._filterRecords): 17 * inspector/front-end/inspector.css: 18 (.timeline-records-counter): 19 1 20 2010-03-30 Philippe Normand <pnormand@igalia.com> 2 21 -
trunk/WebCore/inspector/front-end/TimelinePanel.js
r56613 r56772 105 105 get statusBarItems() 106 106 { 107 return [this.toggleFilterButton.element, this.toggleTimelineButton.element, this.clearButton.element ];107 return [this.toggleFilterButton.element, this.toggleTimelineButton.element, this.clearButton.element, this.recordsCounter]; 108 108 }, 109 109 … … 162 162 this.toggleFilterButton = new WebInspector.StatusBarButton(WebInspector.UIString("Show short records"), "timeline-filter-status-bar-item"); 163 163 this.toggleFilterButton.addEventListener("click", this._toggleFilterButtonClicked.bind(this), false); 164 165 this.recordsCounter = document.createElement("span"); 166 this.recordsCounter.className = "timeline-records-counter"; 167 }, 168 169 _updateRecordsCounter: function() 170 { 171 this.recordsCounter.textContent = WebInspector.UIString("%d of %d captured records are visible", this._rootRecord._visibleRecordsCount, this._rootRecord._allRecordsCount); 164 172 }, 165 173 … … 231 239 232 240 var formattedRecord = new WebInspector.TimelinePanel.FormattedRecord(record, parentRecord, this._recordStyles, this._sendRequestRecords, this._timerRecords); 241 ++this._rootRecord._allRecordsCount; 242 233 243 if (parentRecord === this._rootRecord) 234 244 formattedRecord.collapsed = true; … … 243 253 while (record.parent && record.parent._lastChildEndTime < record._lastChildEndTime) { 244 254 record.parent._lastChildEndTime = record._lastChildEndTime; 255 if (!record.parent._hasLongChildrenEvents) 256 record.parent._hasLongChildrenEvents = record._isLongEvent(); 245 257 record = record.parent; 246 }247 // We have attached a fresh event record received from Timeline Agent to some old event record.248 // If that old parent record haven't had long children events and new child record has it249 // then we want to propagate _hasLongChildrenEvents flag to parent, grand-parent etc.250 if (record._isLongEvent()) {251 record = formattedRecord;252 while (record.parent && !record.parent._isLongEvent()) {253 record = record.parent;254 record._hasLongChildrenEvents = true;255 }256 258 } 257 259 } … … 283 285 var rootRecord = {}; 284 286 rootRecord.children = []; 287 rootRecord._visibleRecordsCount = 0; 288 rootRecord._allRecordsCount = 0; 285 289 return rootRecord; 286 290 }, … … 330 334 _scheduleRefresh: function(preserveBoundaries) 331 335 { 332 if (preserveBoundaries) 333 this._closeRecordDetails(); 336 this._closeRecordDetails(); 334 337 this._boundariesAreValid &= preserveBoundaries; 335 338 if (this._needsRefresh) … … 356 359 this._overviewPane.update(this._rootRecord.children); 357 360 this._refreshRecords(!this._boundariesAreValid); 361 this._updateRecordsCounter(); 358 362 this._boundariesAreValid = true; 359 363 }, … … 361 365 _updateBoundaries: function() 362 366 { 363 364 365 366 367 368 369 370 371 }, 372 373 _addToRecordsWindow: function(record, recordsWindow )367 this._calculator.reset(); 368 this._calculator.windowLeft = this._overviewPane.windowLeft; 369 this._calculator.windowRight = this._overviewPane.windowRight; 370 371 for (var i = 0; i < this._rootRecord.children.length; ++i) 372 this._calculator.updateBoundaries(this._rootRecord.children[i]); 373 374 this._calculator.calculateWindow(); 375 }, 376 377 _addToRecordsWindow: function(record, recordsWindow, parentIsCollapsed) 374 378 { 375 379 if (!this._calculator._showShortEvents && !record._isLongEvent()) 376 380 return; 377 378 recordsWindow.push(record); 381 var percentages = this._calculator.computeBarGraphPercentages(record); 382 if (percentages.start < 100 && percentages.endWithChildren >= 0 && !record.category.hidden) { 383 ++this._rootRecord._visibleRecordsCount; 384 ++record.parent._invisibleChildrenCount; 385 if (!parentIsCollapsed) 386 recordsWindow.push(record); 387 } 388 379 389 var index = recordsWindow.length; 380 if (!record.collapsed) { 381 for (var i = 0; i < record.children.length; ++i) 382 this._addToRecordsWindow(record.children[i], recordsWindow); 383 } 384 record.visibleChildrenCount = recordsWindow.length - index; 390 record._invisibleChildrenCount = 0; 391 for (var i = 0; i < record.children.length; ++i) 392 this._addToRecordsWindow(record.children[i], recordsWindow, parentIsCollapsed || record.collapsed); 393 record._visibleChildrenCount = recordsWindow.length - index; 385 394 }, 386 395 … … 388 397 { 389 398 var recordsInWindow = []; 390 for (var i = 0; i < this._rootRecord.children.length; ++i) { 391 var record = this._rootRecord.children[i]; 392 var percentages = this._calculator.computeBarGraphPercentages(record); 393 if (percentages.start < 100 && percentages.endWithChildren >= 0 && !record.category.hidden) 394 this._addToRecordsWindow(record, recordsInWindow); 395 } 399 this._rootRecord._visibleRecordsCount = 0; 400 for (var i = 0; i < this._rootRecord.children.length; ++i) 401 this._addToRecordsWindow(this._rootRecord.children[i], recordsInWindow); 396 402 return recordsInWindow; 397 403 }, … … 557 563 this._absoluteMinimumBoundary = lowerBound; 558 564 559 var upperBound = record._lastChildEndTime; 565 const minimumTimeFrame = 0.1; 566 const minimumDeltaForZeroSizeEvents = 0.01; 567 var upperBound = Math.max(record._lastChildEndTime + minimumDeltaForZeroSizeEvents, lowerBound + minimumTimeFrame); 560 568 if (this._absoluteMaximumBoundary === -1 || upperBound > this._absoluteMaximumBoundary) 561 569 this._absoluteMaximumBoundary = upperBound; … … 668 676 this._barElement.style.width = barPosition.width + "px"; 669 677 670 if (record. visibleChildrenCount || record._hasLongChildrenEvents || (calculator._showShortEvents && record.children.length)) {678 if (record._visibleChildrenCount || record._invisibleChildrenCount) { 671 679 this._expandElement.style.top = index * this._rowHeight + "px"; 672 680 this._expandElement.style.left = barPosition.left + "px"; 673 681 this._expandElement.style.width = Math.max(12, barPosition.width + 25) + "px"; 674 682 if (!record.collapsed) { 675 this._expandElement.style.height = (record. visibleChildrenCount + 1) * this._rowHeight + "px";683 this._expandElement.style.height = (record._visibleChildrenCount + 1) * this._rowHeight + "px"; 676 684 this._expandElement.addStyleClass("timeline-expandable-expanded"); 677 685 this._expandElement.removeStyleClass("timeline-expandable-collapsed"); -
trunk/WebCore/inspector/front-end/inspector.css
r56711 r56772 3658 3658 } 3659 3659 3660 .timeline-records-counter { 3661 font-size: 11px; 3662 position: relative; 3663 top: 5px; 3664 margin-left: 5px; 3665 text-shadow: white 0 1px 0; 3666 } 3667 3660 3668 /* Profiler Style */ 3661 3669
Note: See TracChangeset
for help on using the changeset viewer.