[whatwg] Status bars and progress indicators

Ian Hickson ian at hixie.ch
Sun Nov 21 11:37:04 PST 2004


On Fri, 24 Sep 2004, Matthew Thomas wrote:
> > > 
> > > with the exception of "14 Percent", which I can't imagine anyone 
> > > using instead of "14 %". The parsing is simple: if there's only one 
> > > number in the contents, treat it as a percentage if "%" is present 
> > > and as a decimal fraction otherwise. And if there's more than one 
> > > number in the contents, treat the first two numbers as a fraction.
> > 
> > <gage><img src="fourteen_percent.gif"></gage>
> 
> Invalid: you're missing alt=, which should contain the value in 
> parseable format otherwise it'll be inaccessible. Well done for 
> requiring a clarification of "in the contents", though: "in the contents 
> (including any alternate text of child elements)". (Example #4792 of why 
> alt= shouldn't have been an attribute in the first place.)

That would be a big pain. I'd rather not deviate from just using 
.textContent, especially since it is what I have been using in multiple 
other places in the WHATWG specs for this kind of thing.

We _could_ special case a fallback behaviour along the lines of "if you 
don't find any numbers, then look at the IMG descendents and pick the 
first one whose alt="" text contains a number". Would that be ok?

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



More information about the whatwg mailing list