Index: chrome/browser/resources/shared/js/cr/ui/list.js |
diff --git a/chrome/browser/resources/shared/js/cr/ui/list.js b/chrome/browser/resources/shared/js/cr/ui/list.js |
index 3d6d0c3f138af7979d388949ee4273c07aa61ca1..dc4f91a9f16e7dfe63d305260a07088e5f0231d2 100644 |
--- a/chrome/browser/resources/shared/js/cr/ui/list.js |
+++ b/chrome/browser/resources/shared/js/cr/ui/list.js |
@@ -1048,6 +1048,10 @@ cr.define('cr.ui', function() { |
return; |
} |
+ // Save the previous positions before any manipulation of elements. |
+ var scrollTop = this.scrollTop; |
+ var clientHeight = this.clientHeight; |
+ |
// Store all the item sizes into the cache in advance, to prevent |
// interleave measuring with mutating dom. |
if (!this.fixedHeight_) |
@@ -1059,8 +1063,6 @@ cr.define('cr.ui', function() { |
var newCachedItems = {}; |
var autoExpands = this.autoExpands_; |
- var scrollTop = this.scrollTop; |
- var clientHeight = this.clientHeight; |
var itemsInViewPort = this.getItemsInViewPort(scrollTop, clientHeight); |
// Draws the hidden rows just above/below the viewport to prevent |