summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-24 01:40:30 +0000
committermtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-24 01:40:30 +0000
commit1bf99f301afb5f5cfe0f0fc6056f66b108b711f8 (patch)
tree5a277c67b708cceda3e40e2b0978d2ca41354e59
parent9c3634697da732e85d2405daf206b109d61ff4f6 (diff)
downloadchromium_src-1bf99f301afb5f5cfe0f0fc6056f66b108b711f8.zip
chromium_src-1bf99f301afb5f5cfe0f0fc6056f66b108b711f8.tar.gz
chromium_src-1bf99f301afb5f5cfe0f0fc6056f66b108b711f8.tar.bz2
Merge 224158 "Fixed rendering of the webui list."
> Fixed rendering of the webui list. > > Recently all of the items in the webui list got cached, for performance. However, this caused one issue. In webui's list with autoExpand option set to false, only visible items are rendered + the selected item. Therefore, if the selected item is out of the visible rect, then it will be rendered, but hidden. This is to keep focus, aria selection indexes, etc. And the problem occurs here. If the selection changes, the pinned item stays in cache with the hidden attribute on. If it is later rendered, then it is basically hidden. That's all. Therefore, we need to keep it in cache with removed the hidden attribute. That's what this patch does to resolve this issue. > > The bug caused lots of problems in rendering in the Files app, like disappearing files. > > TEST=Tested manually. > BUG=294504,289682,275275,partner:22244 > > Review URL: https://chromiumcodereview.appspot.com/24251002 TBR=mtomasz@chromium.org Review URL: https://codereview.chromium.org/24066013 git-svn-id: svn://svn.chromium.org/chrome/branches/1599/src@224851 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/webui/resources/js/cr/ui/list.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/webui/resources/js/cr/ui/list.js b/ui/webui/resources/js/cr/ui/list.js
index 52f2896..080aa9c 100644
--- a/ui/webui/resources/js/cr/ui/list.js
+++ b/ui/webui/resources/js/cr/ui/list.js
@@ -1105,10 +1105,15 @@ cr.define('cr.ui', function() {
var sm = this.selectionModel;
var leadIndex = sm.leadIndex;
+ // If the pinned item is hidden and it is not the lead item, then remove
+ // it from cache. Note, that we restore the hidden status to false, since
+ // the item is still in cache, and may be reused.
if (this.pinnedItem_ &&
this.pinnedItem_ != this.cachedItems_[leadIndex]) {
- if (this.pinnedItem_.hidden)
+ if (this.pinnedItem_.hidden) {
this.removeChild(this.pinnedItem_);
+ this.pinnedItem_.hidden = false;
+ }
this.pinnedItem_ = undefined;
}