+2012-05-17 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: add an option to show last N hidden children of node in heap profiler
+ https://bugs.webkit.org/show_bug.cgi?id=86757
+
+ Reviewed by Pavel Feldman.
+
+ Renamed "Show next N" to "Show N before" and added "Show N after" button. Also
+ when all 3 buttons would have equal effect there is now only "Show all N" button.
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ShowMoreDataGridNode.js:
+ (WebInspector.ShowMoreDataGridNode):
+ (WebInspector.ShowMoreDataGridNode.prototype._showLastChunk):
+ (WebInspector.ShowMoreDataGridNode.prototype._updateLabels):
+ (WebInspector.ShowMoreDataGridNode.prototype.createCells):
+
2012-05-17 Ryosuke Niwa <rniwa@webkit.org>
WebKit erroneously add 1px padding in input elements
this.showNext = document.createElement("button");
this.showNext.setAttribute("type", "button");
this.showNext.addEventListener("click", this._showNextChunk.bind(this), false);
+ this.showNext.textContent = WebInspector.UIString("Show %d before", this._chunkSize);
this.showAll = document.createElement("button");
this.showAll.setAttribute("type", "button");
this.showAll.addEventListener("click", this._showAll.bind(this), false);
+ this.showLast = document.createElement("button");
+ this.showLast.setAttribute("type", "button");
+ this.showLast.addEventListener("click", this._showLastChunk.bind(this), false);
+ this.showLast.textContent = WebInspector.UIString("Show %d after", this._chunkSize);
+
this._updateLabels();
this.selectable = false;
}
this._callback(this._startPosition, this._endPosition);
},
+ _showLastChunk: function()
+ {
+ this._callback(this._endPosition - this._chunkSize, this._endPosition);
+ },
+
_updateLabels: function()
{
var totalSize = this._endPosition - this._startPosition;
- var nextChunkSize = Math.min(this._chunkSize, totalSize);
- this.showNext.textContent = WebInspector.UIString("Show next %d", nextChunkSize);
+ if (totalSize > this._chunkSize) {
+ this.showNext.removeStyleClass("hidden");
+ this.showLast.removeStyleClass("hidden");
+ } else {
+ this.showNext.addStyleClass("hidden");
+ this.showLast.addStyleClass("hidden");
+ }
this.showAll.textContent = WebInspector.UIString("Show all %d", totalSize);
},
if (this.depth)
cell.style.setProperty("padding-left", (this.depth * this.dataGrid.indentWidth) + "px");
cell.appendChild(this.showNext);
- if (this.showAll)
- cell.appendChild(this.showAll);
+ cell.appendChild(this.showAll);
+ cell.appendChild(this.showLast);
this._element.appendChild(cell);
var columns = this.dataGrid.columns;