This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 11162 - select.size should either be web-compatible or make sense, take your pick
Summary: select.size should either be web-compatible or make sense, take your pick
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
Depends on:
Reported: 2010-10-28 21:26 UTC by contributor
Modified: 2011-08-04 05:02 UTC (History)
8 users (show)

See Also:


Description contributor 2010-10-28 21:26:44 UTC

This test case alerts 0 in all current released browsers:
data:text/html,<!doctype html><script>var el =
document.createElement("select"); el.multiple = true; alert(el.size);</script>
 As it stands, the spec says it should alert 1.  While we're in the habit of
making the world making more sense, why not say that the default for the size
IDL attribute is the same as for the size content attribute, namely that it's
4 if multiple is set and 1 otherwise?  (What does it even mean for a content
attribute to have a default?)

Posted from:
Comment 1 Aryeh Gregor 2010-10-28 21:31:10 UTC
I meant to add, the spec used to imply this until this commit:

But then it went back to saying 1 across the board for some reason.  Note that Firefox 4 does the 1-and-4 thing like the old spec version.  volkmar and smaug mentioned something in #whatwg about a regression bug, but anyway, I can't see how "1 across the board" is any more web-compatible than "sometimes 1 and sometimes 4" if all current browsers make the default 0.
Comment 2 Aryeh Gregor 2010-10-28 21:35:36 UTC
Okay, here's the Mozilla bug:

So maybe it should just have a default of 0, or maybe all unsigned longs limited to only positive values should if no other default is specified.  See also bug 10354, which is related.  But it shouldn't have a default of 1 across the board, that makes no sense from any perspective.
Comment 3 Ian 'Hixie' Hickson 2011-01-20 23:45:16 UTC
I've changed it to zero per the Gecko bug. I haven't changed this for the other attributes; please file a separate bug for them if you think they should change (IIRC that change was the right change for the other attributes, and select.size is special).

Re comment 1, I don't see how that patch affects this.

EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with one of the reporter's comments.
Comment 4 contributor 2011-01-20 23:45:39 UTC
Checked in as WHATWG revision r5793.
Check-in comment: change select.size once more, to match browsers
Comment 5 Michael[tm] Smith 2011-08-04 05:02:27 UTC
mass-moved component to LC1