[whatwg] <progress> draft

Matthew Raymond mattraymond at earthlink.net
Sun Mar 26 17:59:38 PST 2006


Ric Hardacre wrote:
> how about a "%" indicates a percentage from 0 to 100. if the % is 
> missing then assume a fraction so:
> 
> <progress value="0.4375"></progress>
> <progress value="43.75%"></progress>
> 
> are the same as far as DOM and scripting are concerned, for both: 
> element.value == 0.4375;
> 
> <progress value="43.75"></progress>
> 
> would render as "100%" as it is greater than 1.0, the maximum fractional 
> amount


   Actually, assuming <progress> has |min| and |max| attributes, you
could have defaults of |min| 0.0 (or 0%) and |max| as 1.0 or (100%). In
this way, you could have |max| as the number of kilobytes for a file and
update the value of <progress> with just the number of kilobytes
transferred, and the progress bar would show the fraction of |max| that
the value is. (Not sure we need a |min| attribute. the use case seems weak.)

   With regard to "[number]%", it can simply be equal to "[number/100]".



More information about the whatwg mailing list