[Bug 25587] Be more clear that progress events are about bytes being transferred

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25587

--- Comment #11 from Glenn Maynard <glenn@zewt.org> ---
For download progress, showing bytes transferred makes sense.  I seem to recall
some digital download services showing download speeds in uncompressed bytes,
which seemed like a pretty sad lie (look, we're faster than everyone else!),
and we'd be making everyone do that if we used bytes after decompression.

I assume you mean "number of compressed bytes, not including protocol overhead"
(HTTP chunked headers, SSL packet data, etc.), since otherwise the "total"
value would never be known.  I wonder if that's tricky for HTTPS TLS-level
compression, where the compressed data size might not be exposed to the upper
layer, and if it means that TLS compression would always disable "total".

(In reply to Takeshi Yoshino from comment #8)
> > For download progress you can work around this by watching onload and
> > treating that as a progress(total, total) event, but that shouldn't be
> > required.
> 
> Similar logic could be applied to error scenarios. I.e. we could say that we
> should be able to know some error occurred by looking at only "progress"
> ProgressEvents. And then, we'll e.g. change the color of the progress bar to
> red when it sees "loaded" becoming 0 from non-zero or "total" becoming 0
> from non-zero.

My logic was for using progress events for progress displays, not for figuring
out if the transfer finished.  You should use onload, onloadend and onerror for
their tasks; don't try to use onprogress to detect if an error occurred.  (What
I was describing was making sure progress bars actually fill to 100% when the
transfer is complete, and don't hover at 99% because the browser never sent any
progress event with loaded == total due to the throttling logic, since
developers shouldn't have to take extra steps to avoid that.)

If I start XHR and see "0 bytes, 100 bytes, 200 bytes" and then an error
happens, I shouldn't see a progress event saying "0 bytes".  I wouldn't want my
progress meters or percent displays to snap back to 0 on error.  (I might want
to hide them, but I might also want to leave them, so the user can see how far
the transfer went before it failed.)  It's also just weird...

(By the way, you'd have a bug: the progress bar wouldn't become red if an error
occurred before loading any bytes, since loaded was never nonzero.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 8 September 2014 23:07:34 UTC