W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2006

[whatwg] finding a number...

From: Thomas Broyer <t.broyer@gmail.com>
Date: Wed, 13 Dec 2006 12:14:48 +0100
Message-ID: <a9699fd20612130314o20cee62fv32444d512d97d8c2@mail.gmail.com>
2006/12/13, Henri Sivonen:
> The attributes [on the meter and progress elements] always work
> for any language. For English, the textContent works as a *bonus*.
> It isn't that the spec fails to work for non-English. It is just that a
> particular *redundant* bonus feature doesn't work for non-English.
> If giving redundant bonus features to English-language pages is
> deemed politically too incorrect, I'd rather get rid of the
> textContent stuff than introduce the huge can of worms language-
> dependent number parsing.


If you start using HTML5 new features, why not use them "fully"?
I think the rationale behind the 'textContent' stuff is that you then
have only one place to edit when you change the <meter> or <progress>
values; so that you never have a <progress> showing 25% while the
"fallback text content" says it is now 75% (or the opposite).

Note that the <meter> description reads (as an "Authoring requirements" !!!):
"The recommended way of giving the value is to include it as contents
of the element, either as two numbers (the higher number represents
the maximum, the other number the current value), or as a percentage
or similar (using one of the characters such as "%"), or as a
And the <progress> description reads:
"Instead of using the attributes, authors are recommended to simply
include the current value and the maximum value inline as text inside
the element."

I fully understand the rationale behind this (ease of editing
?changing the value once, at a single place? means ease of adoption),
but I18N is important too.
Having mandatory attributes also makes writing parsers easier, because
you no longer need the "steps for finding one or two numbers of a
ratio in a string" part ;-)

And how about "vulgar fraction characters" like ? (U+00BC VULGAR
FRACTION ONE QUARTER) and other numeric characters from the ?(U+FF10

I don't know which is better (parsing only "english-form numbers" out
of textContent, or having attributes mandatory), but the two
recommendations towards using textContent to convey the values,
preferably to using attributes, is only relevant to english
documents/sections, or actually any language with the same number
formatting rules).

What I know is that I don't want language-dependent number parsing to
appear in the spec ;-)

Thomas Broyer
Received on Wednesday, 13 December 2006 03:14:48 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:51 UTC