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

[whatwg] size content attribute on <input type=number>

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Sun, 6 Sep 2009 21:51:52 -0400
Message-ID: <7c2a12e20909061851x428a5387hd8555d31975e71ab@mail.gmail.com>
The current spec prohibits input elements in the Number state from
having the size attribute:

http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#number-state

I don't see the reason for this.  It seems at least as likely that the
author would like to provide a hint for the length of a number field
as, say, a URL field.  Users are likely to only want to submit one- or
two-digit numbers in some cases, and decimal numbers with very high
precision in other cases.  It would be reasonable to have size=3 for
an "age" field, for instance, but a much larger size for a field in a
scientific application.  Of course, if the UA provides an input
mechanism that doesn't resemble a text box, it might not be relevant
to that particular UA, but a text-boxy thing is a logical way to
implement type=number, and in fact that's how Opera does it.

Also note that even when UAs are expected to implement special input
mechanisms where specifying size doesn't make sense, it could still be
useful to specify a size to get more graceful fallback in older
browsers.  The default <input> size in most browsers is likely quite a
lot larger than necessary to specify a time, for instance.  It's worth
considering allowing size for all the new input types for that reason.

Personally I wouldn't object if the size attribute were scrapped
entirely in favor of CSS, since it seems basically presentational to
me.  But if it's present, I don't see why it's not as appropriate for
number as anything else.
Received on Sunday, 6 September 2009 18:51:52 UTC

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