[whatwg] finding a number...

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.

+1

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
fraction."
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
FULLWIDTH DIGIT ZERO) to?(U+FF19 FULLWIDTH DIGIT NINE) or ? (U+2160
ROMAN NUMERAL ONE) to ? (U+2182 ROMAN NUMERAL TEN THOUSAND) ranges?

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