Bjoern Hoehrmann wrote:
* Jonas Sicking wrote:
In many cases the user might know the size even if the implementation
does not. Or it is even imaginable that the script knows the size even
if the XHR class does not. In both these cases the number of bytes
transferred is useful to present.
Right, they have currentSize = knownSize * position/total for that, no?
I'm not following you here. What properties are you proposing to make
available?
LSProgress gives you a percentage of how much data has been transferred;
if you know the total size and the total size property on the LSProgress
object match, you can calculate the number of bytes transferred so far,
no matter the units used.
The problem lies in if the XHR implementation doesn't know the total
size. Then it can't give you a percentage.
If it gives you the number of bytes transferred do far, the user or the
script can figure out the progress even if the XHR implementation
doesn't know the total size.
/ Jonas