W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2007

[whatwg] <meter> with Only 1 Number

From: Smylers <Smylers@stripey.com>
Date: Thu, 12 Jul 2007 17:13:50 +0100
Message-ID: <20070712161350.GA19416@stripey.com>
<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

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:36 UTC