Closed Bug 970032 Opened 11 years ago Closed 11 years ago

Download toolbar button doesn't indicate any activity when downloading files of unknown size

Categories

(Firefox :: Downloads Panel, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 948956

People

(Reporter: ttaubert, Assigned: manishearth)

Details

Attachments

(1 file)

Using https://fipelines.org/ to transfer files between machines, I don't see any activity indicator on the target machine after the download has started. Only on finish I can see the completion animation. Couldn't we implement a progress indicator [1] that is shown as long as there are active downloads and none of them has a known size? [1] http://imgur.com/bgVrJWx
Summary: Download toolbar button doesn't indicate any activity when downloading content with unknown size → Download toolbar button doesn't indicate any activity when downloading files of unknown size
Chrome does something similar, instead of a circular progress bar it has a circular throbber-like thing. Instead of having a striped bar, it might be better (and most probably easier to implement) to have a bar where a smaller green bar just flows through it. Like this[1], but shinier. (Probably should have a look at how downloads bar is generated) [1]: http://i.stack.imgur.com/w3pfj.gif
Also, verified bug. Infinite download testcase here[1] (PHP file with content-disposition:attachment that uses output buffers and while(true) ) [1]: http://manishearth.anapnea.net/test.php
So, this can be done by swapping the `mode` of the progressmeter here[1] from determined to undetermined. Will look into this more if I get the time. [1]: http://mxr.mozilla.org/mozilla-central/source/browser/components/downloads/content/indicatorOverlay.xul#29
Hmm, running document.getElementById("downloads-indicator-progress").setAttribute("mode","undetermined") for testing seems to make it increase in size, vertically, rapidly destroying the toolbar. Which is strange.
Got the source of the confusion. progressmeter.xml[1] implements the two modes differently, in one case you have two side by side spacers, in the other you have a single spacer inside a stack. I was able to fix this by tweaking indicator.css[2]. I've got a partial fix on this, will finish it up later today. [1]: http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/progressmeter.xml [2]: http://mxr.mozilla.org/mozilla-central/source/browser/themes/linux/downloads/indicator.css
Status: NEW → ASSIGNED
Got the source of the confusion. progressmeter.xml[1] implements the two modes differently, in one case you have two side by side spacers, in the other you have a single spacer inside a stack. I was able to fix this by tweaking indicator.css[2]. I've got a partial fix on this, will finish it up later today. [1]: http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/progressmeter.xml [2]: http://mxr.mozilla.org/mozilla-central/source/browser/themes/linux/downloads/indicator.css
Unpolished patch. I've only done the theming for linux, if you try this on a different OS the downloads indicator will become huge. (Simple matter of copying the styles over, but I'd rather get all changes done before doing that) I also restructured the code a bit, in the past changes to `percentComplete` in indicator.js were used to trigger changes in the displayed state of the downloads indicator. Since `percentComplete=-1` applies to virus scans and indeterminate downloads, as well as a lack of downloads, I separated the "change indicator state" code from the "change progressbar state". I added a couple more symbols that get exported from DownloadsIndicatorData to the view (hasActiveDownloads,isUndetermined). I hope that's OK, it seems to be created as a generic API which addons may use as well (which is why I didn't simply change the behavior of `percentComplete` so that it can be -2 when there are indeterminate downloads). This patch doesn't yet respond on pause events; but neither does the progressbar in the downloads popup. That might be a separate bug.
Assignee: nobody → manishearth
Attachment #8373065 - Flags: review?(ttaubert)
Comment on attachment 8373065 [details] [diff] [review] Patch - Working infinite downloads indicator; linux only. Restructured indicator-updating code Thanks for working on this Manish. I have no clue of the download (panel) code, though. Redirecting to Paolo!
Attachment #8373065 - Flags: review?(ttaubert) → review?(paolo.mozmail)
this is a duplicate of bug 948956, that is already tracked in our backlog, please move the patch and the discussion there
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Attachment #8373065 - Flags: review?(paolo.mozmail)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: