| 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 ddb8a45fa8832a4ac66bf23f832ebf1435d421b1..fb920efd36231c0f209a8d3e89b031b26ea8aba1 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
|
| @@ -378,8 +378,7 @@ WebInspector.ViewportControl.prototype = {
|
| if (!this._visibleHeight())
|
| return; // Do nothing for invisible controls.
|
|
|
| - var itemCount = this._provider.itemCount();
|
| - if (!itemCount) {
|
| + if (!this._provider.itemCount()) {
|
| for (var i = 0; i < this._renderedItems.length; ++i)
|
| this._renderedItems[i].willHide();
|
| this._renderedItems = [];
|
| @@ -399,18 +398,18 @@ WebInspector.ViewportControl.prototype = {
|
| this._scrolledToBottom = this.element.isScrolledToBottom();
|
| var isInvalidating = !this._cumulativeHeights;
|
|
|
| - if (this._cumulativeHeights && itemCount !== this._cumulativeHeights.length)
|
| - delete this._cumulativeHeights;
|
| for (var i = 0; i < this._renderedItems.length; ++i) {
|
| // Tolerate 1-pixel error due to double-to-integer rounding errors.
|
| if (this._cumulativeHeights && Math.abs(this._cachedItemHeight(this._firstVisibleIndex + i) - this._renderedItems[i].element().offsetHeight) > 1)
|
| delete this._cumulativeHeights;
|
| }
|
| this._rebuildCumulativeHeightsIfNeeded();
|
| + var itemCount = this._cumulativeHeights.length;
|
| var oldFirstVisibleIndex = this._firstVisibleIndex;
|
| var oldLastVisibleIndex = this._lastVisibleIndex;
|
|
|
| - var shouldStickToBottom = this._stickToBottom && this._scrolledToBottom;
|
| + var shouldStickToBottom = isInvalidating && this._stickToBottom && this._scrolledToBottom;
|
| +
|
| if (shouldStickToBottom) {
|
| this._lastVisibleIndex = itemCount - 1;
|
| this._firstVisibleIndex = Math.max(itemCount - Math.ceil(visibleHeight / this._provider.minimumRowHeight()), 0);
|
|
|