Commit fbe9ae0e authored by alph@chromium.org's avatar alph@chromium.org

DevTools: [timeline tree view] edge of datagrid cut off

BUG=523051

Review URL: https://codereview.chromium.org/1309603002

git-svn-id: svn://svn.chromium.org/blink/trunk@200967 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3701a078
...@@ -230,7 +230,6 @@ WebInspector.DataGrid.prototype = { ...@@ -230,7 +230,6 @@ WebInspector.DataGrid.prototype = {
this._bottomFillerRow.style.height = bottom + "px"; this._bottomFillerRow.style.height = bottom + "px";
else else
this._bottomFillerRow.style.height = "auto"; this._bottomFillerRow.style.height = "auto";
this.element.classList.toggle("data-grid-fits-viewport", top + bottom === 0);
}, },
/** /**
......
...@@ -143,13 +143,13 @@ WebInspector.ViewportDataGrid.prototype = { ...@@ -143,13 +143,13 @@ WebInspector.ViewportDataGrid.prototype = {
/** /**
* @param {number} clientHeight * @param {number} clientHeight
* @param {number} scrollTop * @param {number} scrollTop
* @return {{topPadding: number, bottomPadding: number, visibleNodes: !Array.<!WebInspector.ViewportDataGridNode>, offset: number}} * @return {{topPadding: number, bottomPadding: number, contentHeight: number, visibleNodes: !Array.<!WebInspector.ViewportDataGridNode>, offset: number}}
*/ */
_calculateVisibleNodes: function(clientHeight, scrollTop) _calculateVisibleNodes: function(clientHeight, scrollTop)
{ {
var nodes = this._flatNodesList(); var nodes = this._flatNodesList();
if (this._inline) if (this._inline)
return {topPadding: 0, bottomPadding: 0, visibleNodes: nodes, offset: 0}; return {topPadding: 0, bottomPadding: 0, contentHeight: 0, visibleNodes: nodes, offset: 0};
var size = nodes.length; var size = nodes.length;
var i = 0; var i = 0;
...@@ -168,7 +168,7 @@ WebInspector.ViewportDataGrid.prototype = { ...@@ -168,7 +168,7 @@ WebInspector.ViewportDataGrid.prototype = {
for (; i < size; ++i) for (; i < size; ++i)
bottomPadding += nodes[i].nodeSelfHeight(); bottomPadding += nodes[i].nodeSelfHeight();
return {topPadding: topPadding, bottomPadding: bottomPadding, visibleNodes: nodes.slice(start, end), offset: start}; return {topPadding: topPadding, bottomPadding: bottomPadding, contentHeight: y - topPadding, visibleNodes: nodes.slice(start, end), offset: start};
}, },
/** /**
...@@ -232,6 +232,8 @@ WebInspector.ViewportDataGrid.prototype = { ...@@ -232,6 +232,8 @@ WebInspector.ViewportDataGrid.prototype = {
} }
this.setVerticalPadding(viewportState.topPadding, viewportState.bottomPadding); this.setVerticalPadding(viewportState.topPadding, viewportState.bottomPadding);
var contentFits = viewportState.contentHeight <= clientHeight;
this.element.classList.toggle("data-grid-fits-viewport", contentFits && viewportState.topPadding + viewportState.bottomPadding === 0);
this._lastScrollTop = scrollTop; this._lastScrollTop = scrollTop;
if (scrollTop !== currentScrollTop) if (scrollTop !== currentScrollTop)
this._scrollContainer.scrollTop = scrollTop; this._scrollContainer.scrollTop = scrollTop;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment