Changeset 109102 in webkit
- Timestamp:
- Feb 28, 2012 6:22:06 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109097 r109102 1 2012-02-28 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: show resource dividers on memory counter graphs 4 https://bugs.webkit.org/show_bug.cgi?id=79782 5 6 Resource dividers are drawn on the memory counter graphs. 7 8 Reviewed by Pavel Feldman. 9 10 * inspector/front-end/MemoryStatistics.js: 11 (WebInspector.MemoryStatistics.prototype.updateDividers): 12 (WebInspector.MemoryStatistics.prototype.setMainTimelineGrid): 13 (WebInspector.MemoryStatistics.prototype._updateSize): 14 (WebInspector.MemoryStatistics.prototype.show): 15 (WebInspector.MemoryStatistics.prototype.refresh): 16 (WebInspector.MemoryStatistics.prototype._refreshDividers): 17 * inspector/front-end/TimelineGrid.js: 18 (WebInspector.TimelineGrid.prototype.get dividersElement): 19 (WebInspector.TimelineGrid.prototype.updateDividers): 20 * inspector/front-end/TimelinePanel.js: 21 (WebInspector.TimelinePanel): 22 (WebInspector.TimelinePanel.prototype._timelinesOverviewModeChanged): 23 (WebInspector.TimelinePanel.prototype._refreshRecords): 24 (WebInspector.TimelinePanel.prototype.get timlinePaddingLeft): 25 * inspector/front-end/timelinePanel.css: 26 (#memory-graphs-canvas-container): 27 (#memory-graphs-canvas-container .resources-dividers): 28 1 29 2012-02-28 Nikolas Zimmermann <nzimmermann@rim.com> 2 30 -
trunk/Source/WebCore/inspector/front-end/MemoryStatistics.js
r108993 r109102 47 47 48 48 this._canvasContainer = this._memorySplitView.mainElement; 49 this._canvasContainer.id = "memory-graphs-canvas-container"; 49 50 this._currentValuesBar = this._canvasContainer.createChild("div"); 50 51 this._currentValuesBar.id = "counter-values-bar"; … … 57 58 this._canvas.addEventListener("mouseout", this._onMouseOut.bind(this), true); 58 59 this._canvas.addEventListener("click", this._onClick.bind(this), true); 60 // We create extra timeline grid here to reuse its event dividers. 61 this._timelineGrid = new WebInspector.TimelineGrid(); 62 this._canvasContainer.appendChild(this._timelineGrid.dividersElement); 59 63 60 64 // Populate sidebar … … 204 208 205 209 WebInspector.MemoryStatistics.prototype = { 210 setMainTimelineGrid: function(timelineGrid) 211 { 212 this._mainTimelineGrid = timelineGrid; 213 }, 214 206 215 setTopPosition: function(top) 207 216 { … … 230 239 _updateSize: function() 231 240 { 241 var width = this._mainTimelineGrid.dividersElement.offsetWidth + 1; 242 this._canvasContainer.style.width = width + "px"; 243 232 244 var height = this._canvasContainer.offsetHeight - this._currentValuesBar.offsetHeight; 233 this._canvas.width = this._canvasContainer.offsetWidth;245 this._canvas.width = width; 234 246 this._canvas.height = height; 235 247 }, … … 385 397 this._memorySplitView.show(this._timelinePanel.element, anchor); 386 398 this._updateSize(); 399 this._refreshDividers(); 387 400 setTimeout(this._draw.bind(this), 0); 388 401 }, … … 391 404 { 392 405 this._updateSize(); 406 this._refreshDividers(); 393 407 this._draw(); 394 408 this._refreshCurrentValues(); … … 398 412 { 399 413 this._memorySplitView.detach(); 414 }, 415 416 _refreshDividers: function() 417 { 418 this._timelineGrid.updateDividers(true, this._timelinePanel.calculator, this._timelinePanel.timelinePaddingLeft); 400 419 }, 401 420 -
trunk/Source/WebCore/inspector/front-end/SidebarOverlay.js
r109006 r109102 114 114 if (this._resizerWidgetElement) 115 115 this.element.removeChild(this._resizerWidgetElement); 116 element.removeEventListener("DOMFocusIn", this._boundContainingElementFocused );116 element.removeEventListener("DOMFocusIn", this._boundContainingElementFocused, false); 117 117 }, 118 118 -
trunk/Source/WebCore/inspector/front-end/TimelineGrid.js
r96939 r109102 59 59 }, 60 60 61 get dividersElement() 62 { 63 return this._dividersElement; 64 }, 65 61 66 /** 62 67 * @param {number=} paddingLeft … … 77 82 var dividerLabelBar = this._dividersLabelBarElement.firstChild; 78 83 79 var dividers LabelBarElementClientWidth = this._dividersLabelBarElement.clientWidth;80 var clientWidth = dividers LabelBarElementClientWidth - paddingLeft;84 var dividersElementClientWidth = this._dividersElement.clientWidth; 85 var clientWidth = dividersElementClientWidth - paddingLeft; 81 86 for (var i = paddingLeft ? 0 : 1; i <= dividerCount; ++i) { 82 87 if (!divider) { … … 92 97 dividerLabelBar.appendChild(label); 93 98 this._dividersLabelBarElement.appendChild(dividerLabelBar); 94 dividersLabelBarElementClientWidth = this._dividersLabelBarElement.clientWidth;95 99 } 96 100 … … 112 116 113 117 var left = paddingLeft + clientWidth * (i / dividerCount); 114 var percentLeft = 100 * left / dividers LabelBarElementClientWidth;118 var percentLeft = 100 * left / dividersElementClientWidth; 115 119 this._setDividerAndBarLeft(divider, dividerLabelBar, percentLeft); 116 120 -
trunk/Source/WebCore/inspector/front-end/TimelinePanel.js
r109009 r109102 80 80 this._itemsGraphsElement.addEventListener("mousewheel", this._overviewPane.scrollWindow.bind(this._overviewPane), true); 81 81 this._containerContentElement.appendChild(this._timelineGrid.element); 82 if (this._memoryStatistics) 83 this._memoryStatistics.setMainTimelineGrid(this._timelineGrid); 82 84 83 85 this._topGapElement = document.createElement("div"); … … 379 381 this.splitView.element.style.height = "auto"; 380 382 this.splitView.element.style.bottom = "0"; 381 this.onResize();382 383 } else { 383 384 this._timelineMemorySplitter.removeStyleClass("hidden"); … … 386 387 this._setSplitterPosition(600); 387 388 } 389 this._refresh(); 388 390 }, 389 391 … … 788 790 this.splitView.sidebarResizerElement.style.height = this.sidebarElement.clientHeight + "px"; 789 791 // Reserve some room for expand / collapse controls to the left for records that start at 0ms. 790 var timelinePaddingLeft = this._calculator.windowLeft === 0 ? this._expandOffset : 0;791 792 if (updateBoundaries) 792 this._timelineGrid.updateDividers(true, this._calculator, t imelinePaddingLeft);793 this._timelineGrid.updateDividers(true, this._calculator, this.timelinePaddingLeft); 793 794 this._adjustScrollPosition((recordsInWindow.length + 1) * rowHeight); 795 }, 796 797 get timelinePaddingLeft() 798 { 799 return this._calculator.windowLeft === 0 ? this._expandOffset : 0; 794 800 }, 795 801 -
trunk/Source/WebCore/inspector/front-end/timelinePanel.css
r109009 r109102 560 560 } 561 561 562 #memory-graphs-canvas-container { 563 border-right: 1px solid #AAA; 564 } 565 566 #memory-graphs-canvas-container .resources-dividers { 567 top: 15px; 568 } 569 562 570 #memory-graphs-container .split-view-contents { 563 571 overflow: hidden;
Note: See TracChangeset
for help on using the changeset viewer.