W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2006

[whatwg] <progress> draft

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Sun, 26 Mar 2006 20:59:38 -0500
Message-ID: <4427470A.3030803@earthlink.net>
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]".
Received on Sunday, 26 March 2006 17:59:38 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:45 UTC