Re: <progress> element and attributes vs. content

Tab Atkins Jr. writes:

> I would be inclined to take the English tradition (, as thousands
> separator, . as decimal separator) as the default, as it is more
> common on the web than the other.  Otherwise, there is *literally* no
> way to resolve the ambiguity.

Yes there is: with commas or other punctuation characters the algorithm
for parsing 2 numbers from a string will fail.  Displaying nothing
(which an author is likely to notice, and which a user is less likely to
believe as correct) is much better than displaying the wrong number.

Many uses of <progress> will involve small integers, which use neither
decimal points nor thousands separators, or integer percentages.

Many people don't put thousands separators in numbers, especially not
those which are only 4 or 5 digits long.

HTML mark-up itself uses a full stop for a decimal point, so authors are
likely to be familiar with it.  Programatically calculated percentages
(whether in JavaScript or a server-side language) as floating point
numbers inserted into the document are likely to stringify using a
decimal point by default, so will just work without any additional
effort by the developer.

The above together cover many uses of <progress>.  Anybody with more
complex requirements can still achieve them by explicitly using the
value attribute, just as they would have to do without the content
parsing feature; content parsing adds convenience which can be used in
many cases but takes nothing away.

Making simple cases easy while still ensuring that complex cases are
possible strikes me as a sensible balance.

Smylers

Received on Saturday, 15 August 2009 06:51:34 UTC