Closed
Bug 828111
Opened 12 years ago
Closed 12 years ago
Workaround multiple reflows issue and slow xbl attachment in the downloads view
Categories
(Firefox :: Downloads Panel, defect, P1)
Firefox
Downloads Panel
Tracking
()
RESOLVED
FIXED
Firefox 21
Tracking | Status | |
---|---|---|
firefox20 | --- | fixed |
People
(Reporter: asaf, Assigned: asaf)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
Gavin
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
I don't think we're going to figure out on time why adding the richlistitems using a DOM fragment doesn't hint gecko that it could avoid all these layout flushes during the giant appendChild call, not to mention fix that. However, I found out that the multiple reflows can be easily avoided by temporarily removing the richlixtbox from the document. This isn't noticeable at at all, and at least on my machine it almost completely resolves the slowness we see on Alice's profile. So, ugly as it is, I think we should go ahead and do it.
I also found out that "un-attaching" the richlistitem binding from the inactive elements has a notable positive effect. This hack I like less, because it could have some side-effects (for example, it'd be a little tricky to have searchLabel working for this items). However, the gain is notable enough that it's at least worth trying. We can take it back later if it turns out to be problematic.
Patch attached. I've also removed the _wasDone setting for history downloads as it's not necessary for them (it's only used in onStateChange).
Attachment #699532 -
Flags: review?(mak77)
Comment 1•12 years ago
|
||
Comment on attachment 699532 [details] [diff] [review]
patch
Review of attachment 699532 [details] [diff] [review]:
-----------------------------------------------------------------
I didn't test the patch locally yet, now going to do that.
::: browser/components/downloads/content/allDownloadsViewOverlay.css
@@ +3,5 @@
> * You can obtain one at http://mozilla.org/MPL/2.0/. */
>
> +richlistitem.download {
> + -moz-binding: none;
> +}
please add comment explaining what this is for and which kind of bad consequences may have.
::: browser/components/downloads/content/allDownloadsViewOverlay.js
@@ +150,1 @@
> this._targetFileInfoFetched = false;
Instead of doing this _wasDone hack, go to
http://mxr.mozilla.org/mozilla-central/source/browser/components/downloads/src/DownloadsCommon.jsm#944
aState there is the previous state, though we lose that information along the way
http://mxr.mozilla.org/mozilla-central/source/browser/components/downloads/src/DownloadsCommon.jsm#984
we should instead forward that information to onStateChange, so we can know whether the download was done. fwiw this is the proper definition of done (not sure why the panel checks !wasDone and openable while the view uses !finished and done?)
http://mxr.mozilla.org/mozilla-central/source/browser/components/downloads/src/DownloadsCommon.jsm#1259
@@ +1071,5 @@
> + let parentNode = this._richlistbox.parentNode;
> + let nextSibling = this._richlistbox.nextSibling;
> + parentNode.removeChild(this._richlistbox);
> + this._richlistbox.appendChild(aDOMFragment);
> + parentNode.insertBefore(this._richlistbox, nextSibling);
trailing spaces.
Is this absolutely needed to avoid the reflows? does setting hidden on the RLB suffice?
Attachment #699532 -
Flags: review?(mak77)
Assignee | ||
Comment 2•12 years ago
|
||
I fixed the "_wasDone" part in bug 828243.
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #699532 -
Attachment is obsolete: true
Attachment #699746 -
Flags: review?(mak77)
Updated•12 years ago
|
Attachment #699746 -
Flags: review?(mak77) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Comment 5•12 years ago
|
||
Assignee | ||
Comment 6•12 years ago
|
||
Regardless of the leak issue, there's another problem with this patch: I need to remove the controller from the richlistbox and add it back after it's inserted back to the tree.
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #699746 -
Attachment is obsolete: true
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
Comment 10•12 years ago
|
||
Comment on attachment 700025 [details] [diff] [review]
address controller issue
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Downloads panel feature
User impact if declined: Performance issues
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): Limited to the feature
String or UUID changes made by this patch: none
Attachment #700025 -
Flags: approval-mozilla-aurora?
Comment 11•12 years ago
|
||
Comment on attachment 700025 [details] [diff] [review]
address controller issue
Is there a bug tracking the removal of this workaround once the core issue is fixed? We should have one on file.
Attachment #700025 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 12•12 years ago
|
||
status-firefox20:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•