[whatwg] <meter> with Only 1 Number

<meter> in the current spec refers to 'the steps for finding one or two
numbers of a ratio in a string', and the user-agent requirements for
determining the maximum value explicitly allow for the textContent to
contain just one number (and no denominator punctuation character) --
for example if the maximum is specified in the attribute, or if the
default max of 1 is desired:

  http://www.whatwg.org/specs/web-apps/current-work/#meter

So these should be allowed:

  <meter max="5">3</meter>

  <meter>0.59</meter>

However the steps referred to don't, despite their name, seem to have
any way of returning just 1 number:

  http://www.whatwg.org/specs/web-apps/current-work/#ratios

The only places where the steps return something (as distinct from
nothing) are step 8, which returns a number and a denominator character,
and step 14, which returns two numbers.

In particular for a <meter> like either of the above, the number will be
parsed as number1 in step 4, then steps 6-8 will have no affect (because
there is no denominator character), step 9 will fail to find a second
number, and therefore step 10 will return nothing.

I think that making step 10 instead return number1 will yield the
desired behaviour.

Smylers

Received on Thursday, 12 July 2007 09:13:50 UTC