Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js

Issue 2359563003: DevTools: fix keyboard navigation in "GoTo File" dialog (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js b/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
index a72752316af77bee595c3799129f54aa07496c34..765e8a0a658ef6364cefbf92f5eadab83a05c78a 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
@@ -585,11 +585,7 @@ WebInspector.ViewportControl.prototype = {
*/
firstVisibleIndex: function()
{
- var firstVisibleIndex;
- if (this._stickToBottom)
- firstVisibleIndex = Math.max(this._itemCount - Math.ceil(this._visibleHeight() / this._provider.minimumRowHeight()), 0);
- else
- firstVisibleIndex = Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights, this.element.scrollTop + 1), 0);
+ var firstVisibleIndex = Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights, this.element.scrollTop + 1), 0);
return Math.max(firstVisibleIndex, this._firstActiveIndex);
},
@@ -624,13 +620,15 @@ WebInspector.ViewportControl.prototype = {
*/
scrollItemIntoView: function(index, makeLast)
{
- if (index > this._firstActiveIndex && index < this._lastActiveIndex)
+ var firstVisibleIndex = this.firstVisibleIndex();
+ var lastVisibleIndex = this.lastVisibleIndex();
+ if (index > firstVisibleIndex && index < lastVisibleIndex)
return;
if (makeLast)
this.forceScrollItemToBeLast(index);
- else if (index <= this._firstActiveIndex)
+ else if (index <= firstVisibleIndex)
this.forceScrollItemToBeFirst(index);
- else if (index >= this._lastActiveIndex)
+ else if (index >= lastVisibleIndex)
this.forceScrollItemToBeLast(index);
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698