Re: Using progress events for other purposes

On Mon, 19 Oct 2009, Simon Pieters wrote:
> On Mon, 19 Oct 2009 10:24:37 +0200, Ian Hickson <ian@hixie.ch> wrote:
> > > > 
> > > > So in a hypothetical system that gives progress for multiple large 
> > > > files in a row, you can't have a case where some of the files have 
> > > > unknown sizes?
> > > 
> > > Yes, you can.
> > 
> > How?
> 
> If I understand Chaals' proposal correctly, you'd set lengthComputable 
> to false, loaded to the number of bytes having been downloaded for the 
> current file, total to 0, loadedItems to the number of files that have 
> finished, and totalItems to the total number of files.

Chaals said "IFF they have lengthComputable true then the loaded and total 
refer to the particular item", which seems to contradict the above. If we 
just say that those attributes are meaningless in events that don't have 
file data, that works, but then the "IFF" condition isn't needed.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 19 October 2009 09:26:27 UTC