Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js b/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js |
| index f6c76505aabecdc7a887e78c322976a75c3580f4..88abc58321212817c7923091116181d910ee6c56 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js |
| @@ -26,7 +26,6 @@ DataGrid.ViewportDataGrid = class extends DataGrid.DataGrid { |
| this._stickToBottom = false; |
| this._updateIsFromUser = false; |
| this._lastScrollTop = 0; |
| - this._firstVisibleIsStriped = false; |
| this.setRootNode(new DataGrid.ViewportDataGridNode()); |
| } |
| @@ -179,25 +178,20 @@ DataGrid.ViewportDataGrid = class extends DataGrid.DataGrid { |
| var tBody = this.dataTableBody; |
| var offset = viewportState.offset; |
| - if (visibleNodes.length) { |
| - var nodes = this.rootNode().flatChildren(); |
| - var index = nodes.indexOf(visibleNodes[0]); |
| - if (index !== -1 && !!(index % 2) !== this._firstVisibleIsStriped) |
| - offset += 1; |
| - } |
| - |
| - this._firstVisibleIsStriped = !!(offset % 2); |
| - |
| for (var i = 0; i < visibleNodes.length; ++i) { |
| var node = visibleNodes[i]; |
| var element = node.element(); |
| - node.setStriped((offset + i) % 2 === 0); |
| if (element !== previousElement.nextSibling) |
| tBody.insertBefore(element, previousElement.nextSibling); |
| node.revealed = true; |
| previousElement = element; |
| } |
| + if (visibleNodes[0]) { |
|
allada
2017/05/22 19:10:29
nit: If length = 0 then v8 will deop, this should
|
| + visibleNodes[0].setStriped(!!(offset % 2)); |
| + visibleNodes[0].updateStripesBelowThisNode(); |
|
allada
2017/05/22 19:10:29
Lets move this into Datagrid.Datagrid instead of t
|
| + } |
| + |
| this.setVerticalPadding(viewportState.topPadding, viewportState.bottomPadding); |
| this._lastScrollTop = scrollTop; |
| if (scrollTop !== currentScrollTop) |
| @@ -256,7 +250,6 @@ DataGrid.ViewportDataGridNode = class extends DataGrid.DataGridNode { |
| this._stale = false; |
| /** @type {?Array<!DataGrid.ViewportDataGridNode>} */ |
| this._flatNodes = null; |
| - this._isStriped = false; |
| } |
| /** |
| @@ -274,21 +267,6 @@ DataGrid.ViewportDataGridNode = class extends DataGrid.DataGridNode { |
| } |
| /** |
| - * @param {boolean} isStriped |
| - */ |
| - setStriped(isStriped) { |
| - this._isStriped = isStriped; |
| - this.element().classList.toggle('odd', isStriped); |
| - } |
| - |
| - /** |
| - * @return {boolean} |
| - */ |
| - isStriped() { |
| - return this._isStriped; |
| - } |
| - |
| - /** |
| * @protected |
| */ |
| clearFlatNodes() { |