W3C home > Mailing lists > Public > public-html@w3.org > August 2010

Re: <select> element @size default

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 12 Aug 2010 15:05:07 -0700
Message-ID: <AANLkTimiRumGe+N31Tuw1QSfRVzf-nQQ7eR5VpMdstnc@mail.gmail.com>
To: Mike Taylor <miketaylr@gmail.com>
Cc: HTMLWG WG <public-html@w3.org>
On Thu, Aug 12, 2010 at 2:55 PM, Mike Taylor <miketaylr@gmail.com> wrote:
> Per the spec, a select element without a required attribute should have its
> size attribute default to 1
> (http://www.whatwg.org/specs/web-apps/current-work/complete.html#the-select-element).
>
> "The size attribute gives the number of options to show to the user. The
> size attribute, if specified, must have a value that is a valid non-negative
> integer greater than zero. If the multiple attribute is present, then the
> size attribute's default value is 4. If the multiple attribute is absent,
> then the size attribute's default value is 1."
>
> A simple test like alert(document.createElement('select').size == 1) fails
> in the latest versions of Opera, Safari/Chrome, Firefox and IE; in fact,
> they all default to 0.
>
> Should the spec be changed to document the current behavior, or should we
> try to get the browsers to implement to 1?

I think I'd be fine with attempting to change browsers here. Reading
the .size attribute seems mostly useful if you're dynamically changing
it, and I can't recall ever seeing a site that did that.

/ Jonas
Received on Thursday, 12 August 2010 22:13:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 12 August 2010 22:13:54 GMT