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 9425 - This section incorrectly specifies what happens when size > 1 but the multiple attribute is not set
Summary: This section incorrectly specifies what happens when size > 1 but the multipl...
Status: CLOSED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: LC
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-05 22:30 UTC by contributor
Modified: 2010-10-04 14:28 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2010-04-05 22:30:50 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#the-select-element

Comment:
This section incorrectly specifies what happens when size > 1 but the multiple
attribute is not set

Posted from: 216.239.45.4
Comment 1 James Robinson 2010-04-05 22:40:54 UTC
From https://bugs.webkit.org/show_bug.cgi?id=36864#c28:

The spec seems to be wrong about this case (when the multiple attribute is not set but size is >1 or dynamically changed from 1 to X>1 and back).  The relevant case for these tests
is what the default selection behavior should be for select elements with
different values for size without the multiple attribute set.  For example,
with the following HTML:

<select size="4">
  <option>a
  <option>b
</select>

which element (if any) should be selected?  The spec says: "If the multiple
attribute is absent, whenever there are no option elements in the select
element's list of options that have their selectedness set to true, the user
agent must set the selectedness of the first option element in the list of
options in tree order that is not disabled, if any, to true." which would mean
that the option "a" would be set to selected as soon as the select is created. 
This is clearly a spec error and no browser actually behaves this way, instead
the initial state of the select is that none of the available options are
selected.

If the option's size attribute is 1 at creation then the first eligible element
should be initially selected.  All browsers seem to properly do this.  The
tricky case is when the size is changed to 1.  In this case, most browsers
(IE/Opera) will set the first eligible option to selected (except for Firefox
which goes into an apparently invalid state).
fast/forms/select-change-popup-to-listbox-roundtrip.html covers changing the
size from an initial value of 5 to 1 then back to 5.  Initially no elements are
selected, then when the size changes to 1 the first element becomes selected
and stays selected when the size changes back to 5.
Comment 2 Ian 'Hixie' Hickson 2010-04-13 00:52:07 UTC
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:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 3 contributor 2010-04-13 00:53:18 UTC
Checked in as WHATWG revision r5010.
Check-in comment: Try to match implementations more closely for <select multiple size=2>
http://html5.org/tools/web-apps-tracker?from=5009&to=5010