[whatwg] <meter> with Only 1 Number

Smylers Smylers at stripey.com
Thu Jul 12 09:13:50 PDT 2007

<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:


So these should be allowed:

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


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


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.


More information about the whatwg mailing list