[whatwg] Status bars and progress indicators

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.   `._.-(,_..'--(,_..'`-.;.'

Received on Sunday, 21 November 2004 11:37:04 UTC