Commit ab531c02 authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

DevTools: keyboard navigation broken in the viewported Network panel

BUG=403430
R=eustas@chromium.org, lushnikov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@180245 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 85944ffe
...@@ -62,7 +62,8 @@ WebInspector.ViewportDataGrid.prototype = { ...@@ -62,7 +62,8 @@ WebInspector.ViewportDataGrid.prototype = {
/** /**
* @protected * @protected
*/ */
scheduleUpdate: function() { scheduleUpdate: function()
{
if (this._updateScheduled) if (this._updateScheduled)
return; return;
this._updateScheduled = true; this._updateScheduled = true;
...@@ -149,6 +150,28 @@ WebInspector.ViewportDataGrid.prototype = { ...@@ -149,6 +150,28 @@ WebInspector.ViewportDataGrid.prototype = {
this._visibleNodes = visibleNodes; this._visibleNodes = visibleNodes;
}, },
/**
* @param {!WebInspector.ViewportDataGridNode} node
*/
_revealViewportNode: function(node)
{
var nodes = this._rootNode.children;
var index = nodes.indexOf(node);
if (index === -1)
return;
var fromY = 0;
for (var i = 0; i < index; ++i)
fromY += nodes[i].nodeSelfHeight();
var toY = fromY + node.nodeSelfHeight();
var scrollTop = this._scrollContainer.scrollTop;
if (scrollTop > fromY)
scrollTop = fromY;
else if (scrollTop + this._scrollContainer.offsetHeight < toY)
scrollTop = toY - this._scrollContainer.offsetHeight;
this._scrollContainer.scrollTop = scrollTop;
},
__proto__: WebInspector.DataGrid.prototype __proto__: WebInspector.DataGrid.prototype
} }
...@@ -192,6 +215,7 @@ WebInspector.ViewportDataGridNode.prototype = { ...@@ -192,6 +215,7 @@ WebInspector.ViewportDataGridNode.prototype = {
*/ */
insertChild: function(child, index) insertChild: function(child, index)
{ {
child.parent = this;
child.dataGrid = this.dataGrid; child.dataGrid = this.dataGrid;
this.children.splice(index, 0, child); this.children.splice(index, 0, child);
child.recalculateSiblings(index); child.recalculateSiblings(index);
...@@ -259,5 +283,10 @@ WebInspector.ViewportDataGridNode.prototype = { ...@@ -259,5 +283,10 @@ WebInspector.ViewportDataGridNode.prototype = {
return result; return result;
}, },
reveal: function()
{
this.dataGrid._revealViewportNode(this);
},
__proto__: WebInspector.DataGridNode.prototype __proto__: WebInspector.DataGridNode.prototype
} }
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