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 27904 - normalize behavior of select options' .defaultSelected, and add .defaultValue
Summary: normalize behavior of select options' .defaultSelected, and add .defaultValue
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-27 11:08 UTC by netmosfera
Modified: 2016-04-27 16:37 UTC (History)
4 users (show)

See Also:


Attachments

Description netmosfera 2015-01-27 11:08:57 UTC
since select-one has no "none-selected" state

<select>
<option>foo</option>
<option>bar</option>
</select>

selectelement.options[0].defaultSelected should return true even if the "selected" attribute on the first <option> wasn't declared explicitly 

basically, it should behave as writing:

<select>
<option selected>foo</option>
<option>bar</option>
</select>

------------------


<select>
<option selected>foo</option>
<option selected>bar</option>
</select>

selectelement.options[1].defaultSelected should return false, since it was declared in a <select>-one


------------------

additionally, since HTMLSelectElement has the "value" property, I'd suggest to add "defaultValue" as well, for consistency:

<select>
    <option selected>foo</option>
</select>

console.log(selectElement.value); // "foo"
console.log(selectElement.defaultValue); // undefined, currently not implemented
Comment 1 Arron Eicholz 2016-04-27 16:37:29 UTC
HTML5.1 Bugzilla Bug Triage: Incubation needed

This bug constitutes a request for a new feature of HTML. The current guidelines [1], rather than track such requests as bugs or issues, please create a proposal outlining the desired behavior, or at least a sketch of what is wanted (much of which is probably contained in this bug), and start the discussion/proposal in the WICG [2]. As your idea gains interest and momentum, it may be brought back into HTML through the Intent to Migrate process [3].
[1] https://github.com/w3c/html#contributing-to-this-repository
[2] https://www.w3.org/community/wicg/
[3] https://wicg.github.io/admin/intent-to-migrate.html