mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 828111 - Workaround multiple reflows issue and slow xbl attachment in the downloads view. r=mak
This commit is contained in:
parent
6b5dcd125c
commit
f0b59062c0
@ -2,6 +2,21 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* The downloads richlistbox may list thousands of items, and it turns out
|
||||
* XBL binding attachment, and even more so detachment, is a performance hog.
|
||||
* This hack makes sure we don't apply any binding to inactive items (inactive
|
||||
* items are history downloads that haven't been in the visible area).
|
||||
* We can do this because the richlistbox implementation does not interact
|
||||
* much with the richlistitem binding. However, this may turn out to have
|
||||
* some side effects (see bug 828111 for the details).
|
||||
*
|
||||
* We might be able to do away with this workaround once bug 653881 is fixed.
|
||||
*/
|
||||
richlistitem.download {
|
||||
-moz-binding: none;
|
||||
}
|
||||
|
||||
richlistitem.download[active] {
|
||||
-moz-binding: url('chrome://browser/content/downloads/download.xml#download-full-ui');
|
||||
}
|
||||
|
@ -1047,10 +1047,20 @@ DownloadsPlacesView.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
this._richlistbox.appendChild(elementsToAppendFragment);
|
||||
this._appendDownloadsFragment(elementsToAppendFragment);
|
||||
this._ensureVisibleElementsAreActive();
|
||||
},
|
||||
|
||||
_appendDownloadsFragment: function DPV__appendDownloadsFragment(aDOMFragment) {
|
||||
// Workaround multiple reflows hang by removing the richlistbox
|
||||
// and adding it back when we're done.
|
||||
let parentNode = this._richlistbox.parentNode;
|
||||
let nextSibling = this._richlistbox.nextSibling;
|
||||
parentNode.removeChild(this._richlistbox);
|
||||
this._richlistbox.appendChild(aDOMFragment);
|
||||
parentNode.insertBefore(this._richlistbox, nextSibling);
|
||||
},
|
||||
|
||||
nodeInserted: function DPV_nodeInserted(aParent, aPlacesNode) {
|
||||
this._addDownloadData(null, aPlacesNode);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user