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 18946 - "whenever" is not clear enough for implementation
Summary: "whenever" is not clear enough for implementation
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-21 07:13 UTC by contributor
Modified: 2012-12-02 00:46 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-09-21 07:13:09 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html
Multipage: http://www.whatwg.org/C#the-select-element
Complete: http://www.whatwg.org/c#the-select-element

Comment:
"whenever" is not clear enough for implementation

Posted from: 81.231.170.159 by simonp@opera.com
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.4; U; en) Presto/2.10.289 Version/12.02
Comment 1 Simon Pieters 2012-09-21 07:20:18 UTC
[[
If the multiple attribute is absent and the element's display size is 1, then 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.
]]

This should be explicitly invoked at certain times rather than saying "whenever".

For instance, when setting value:

[[
On setting, the value attribute must set the selectedness of all the option elements in the list of options to false,
]]
should the "whenever" requirement apply at this point?

[[
and then the first option element in the list of options, in tree order, whose value is equal to the given new value, if any, must have its selectedness set to true.
]]
should it after this?

Similarly with setting selectedIndex.

What Opera has implemented now is that we allow a select to have no selected options if setting value or selectedIndex would end up not selecting anything, which I think is compatible with Firefox. We apply the "whenever" when adding or removing an option.
Comment 2 contributor 2012-12-02 00:46:50 UTC
Checked in as WHATWG revision r7559.
Check-in comment: Try to clean up <option> element selectedness handling.
http://html5.org/tools/web-apps-tracker?from=7558&to=7559