W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] an odd example of the meter element

From: Magnus Kristiansen <magnusrk+whatwg@pvv.org>
Date: Thu, 29 Oct 2009 10:58:17 +0100
Message-ID: <4AE96739.3000202@pvv.org>
Futomi Hatano wrote:
> Hi, all
> 
> I found an odd example in the meter element section of the spec.
> http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-meter-element
> 
> <meter>max: 100; current: 75</meter>
> 
> According to "steps for finding one or two numbers of a ratio in a string", does it means that the actual value is 100 and the max value is 75?
> http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#steps-for-finding-one-or-two-numbers-of-a-ratio-in-a-string
> If so, the gauges would end up looking maxed out.
> Should it be as below?
> 
> <meter>current: 75; max: 100;</meter>
> 
> Thank you.

No, the larger number is always used as the max, and the smaller as 
current. In the meter section: "(...) if there were two numbers parsed 
out of the textContent, then the maximum is the higher of those two 
numbers." and "(...) if the result of processing the textContent of the 
element was two numbers, then the actual value is the lower of the two 
numbers found."

-- 
Magnus Kristiansen
"Don't worry; the Universe IS out to get you."
Received on Thursday, 29 October 2009 02:58:17 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC