Re: Ratios Do Not Return Errors (part of detailed review of common microsyntaxes)

On Wed, 11 Jul 2007, Geoffrey Sneddon wrote:
> On 11 Jul 2007, at 13:17, Smylers wrote:
> > Geoffrey Sneddon writes:
> > 
> > > The rest of the numbers within common microsyntaxes return errors 
> > > when they are unable to return anything else, yet ratios "return 
> > > nothing" ... why do ratios return nothing and not false?
> > 
> > Look at the definition of the <meter> element; getting numbers out of 
> > a ratio is optional (since they can also be specified with attributes, 
> > or default values used), so it is not an error for no numbers to be 
> > returned when trying to parse a ratio:
> > 
> >   http://www.whatwg.org/specs/web-apps/current-work/#meter
> 
> However, you only ever try and parse the textContent if @value has been 
> omitted. If @value has been omitted and the content parses to be 
> nothing, @value is currently assumed to be zero. Surely we should 
> require, when @value is missing, a value to be able to be found within 
> |meter|?

No, the <meter> might just be idling at 0 until the author wants it to be 
something else. I don't see why we would need to force the author to 
include text or use the attributes.

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

Received on Thursday, 8 May 2008 05:43:08 UTC