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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/list.js

Issue 9318012: ui/list.js: prevent from position calculation with wrong position. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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: 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
« 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