Chromium Code Reviews| 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 7db48ee418bcb46a860b58299d228ad44c51ddc6..6de10a89226490cd01b0aa9f422d57a5ef20646e 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js |
| @@ -380,9 +380,9 @@ WebInspector.ViewportControl.prototype = { |
| }, |
| /** |
| - * @param {boolean} isUserGesture |
| + * @param {boolean} isScroll |
| */ |
| - _innerRefresh: function(isUserGesture) |
| + _innerRefresh: function(isScroll) |
|
lushnikov
2016/07/19 00:19:49
let's just remove this argument altogether
|
| { |
| if (!this._visibleHeight()) |
| return; // Do nothing for invisible controls. |
| @@ -416,11 +416,14 @@ WebInspector.ViewportControl.prototype = { |
| var oldFirstVisibleIndex = this._firstVisibleIndex; |
| var oldLastVisibleIndex = this._lastVisibleIndex; |
| - var shouldStickToBottom = !isUserGesture && this._stickToBottom && this._scrolledToBottom; |
| + var shouldStickToBottom = this._stickToBottom && this._scrolledToBottom; |
| if (shouldStickToBottom) { |
| this._lastVisibleIndex = this._itemCount - 1; |
| this._firstVisibleIndex = Math.max(this._itemCount - Math.ceil(visibleHeight / this._provider.minimumRowHeight()), 0); |
| + |
| + if (isScroll) |
| + this._firstVisibleIndex = Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights, visibleFrom + 1), 0); |
|
lushnikov
2016/07/19 00:19:49
let's kill this - viewport control should work fin
|
| } else { |
| this._firstVisibleIndex = Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights, visibleFrom + 1), 0); |
| // Proactively render more rows in case some of them will be collapsed without triggering refresh. @see crbug.com/390169 |
| @@ -568,7 +571,7 @@ WebInspector.ViewportControl.prototype = { |
| */ |
| _onScroll: function(event) |
| { |
| - this._innerRefresh(event.isTrusted); |
| + this._innerRefresh(true); |
| }, |
| /** |