[html5] r8714 - [giow] (2) Try to define what happens when you insert multiple <option selected> [...]
whatwg at whatwg.org
whatwg at whatwg.org
Wed Aug 6 16:12:08 PDT 2014
Author: ianh
Date: 2014-08-06 16:12:05 -0700 (Wed, 06 Aug 2014)
New Revision: 8714
Modified:
complete.html
index
source
Log:
[giow] (2) Try to define what happens when you insert multiple <option selected> elements into a <select> element.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=25997
Affected topics: HTML
Modified: complete.html
===================================================================
--- complete.html 2014-08-06 18:26:29 UTC (rev 8713)
+++ complete.html 2014-08-06 23:12:05 UTC (rev 8714)
@@ -37368,45 +37368,50 @@
<p>If <a href=#nodes-are-inserted id=the-select-element:nodes-are-inserted>nodes are inserted</a> or <a href=#nodes-are-removed id=the-select-element:nodes-are-removed>nodes are removed</a> causing the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-10>list of options</a> to gain or lose one or more
<code id=the-select-element:the-option-element-17><a href=#the-option-element>option</a></code> elements, or if an <code id=the-select-element:the-option-element-18><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-11>list of options</a> <dfn id=ask-for-a-reset>asks for
- a reset</dfn>, then, if the <code id=the-select-element:the-select-element-18><a href=#the-select-element>select</a></code> element's <code id=the-select-element:attr-select-multiple-8><a href=#attr-select-multiple>multiple</a></code> attribute is absent, the <code id=the-select-element:the-select-element-19><a href=#the-select-element>select</a></code>
- element's <a href=#concept-select-size id=the-select-element:concept-select-size-5>display size</a> is 1, and no <code id=the-select-element:the-option-element-19><a href=#the-option-element>option</a></code>
- elements in the <code id=the-select-element:the-select-element-20><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-12>list of
- options</a> have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-9>selectedness</a> set to
- true, the user agent must set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-10>selectedness</a>
- of the first <code id=the-select-element:the-option-element-20><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-13>list of
- options</a> in <a href=#tree-order id=the-select-element:tree-order-2>tree order</a> that is not <a href=#concept-option-disabled id=the-select-element:concept-option-disabled-2>disabled</a>, if any, to true.</p>
+ a reset</dfn>, then, if the <code id=the-select-element:the-select-element-18><a href=#the-select-element>select</a></code> element's <code id=the-select-element:attr-select-multiple-8><a href=#attr-select-multiple>multiple</a></code> attribute is absent, the user agent must run the
+ first applicable set of steps from the following list:</p>
+ <dl class=switch><dt>If the <code id=the-select-element:the-select-element-19><a href=#the-select-element>select</a></code>
+ element's <a href=#concept-select-size id=the-select-element:concept-select-size-5>display size</a> is 1, and no <code id=the-select-element:the-option-element-19><a href=#the-option-element>option</a></code>
+ elements in the <code id=the-select-element:the-select-element-20><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-12>list of
+ options</a> have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-9>selectedness</a> set to
+ true<dd><p>Set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-10>selectedness</a> of the first
+ <code id=the-select-element:the-option-element-20><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-13>list of
+ options</a> in <a href=#tree-order id=the-select-element:tree-order-2>tree order</a> that is not <a href=#concept-option-disabled id=the-select-element:concept-option-disabled-2>disabled</a>, if any, to true.<dt>If two or more <code id=the-select-element:the-option-element-21><a href=#the-option-element>option</a></code> elements in the <code id=the-select-element:the-select-element-21><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-14>list of options</a> have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-11>selectedness</a> set to true<dd><p>Set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-12>selectedness</a> of all but the last
+ <code id=the-select-element:the-option-element-22><a href=#the-option-element>option</a></code> element with its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-13>selectedness</a> set to true in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-15>list of options</a> in <a href=#tree-order id=the-select-element:tree-order-3>tree order</a> to
+ false.</dl>
+
<p>If the <code id=the-select-element:attr-select-multiple-9><a href=#attr-select-multiple>multiple</a></code> attribute is present, and the
element is not <a href=#concept-fe-disabled id=the-select-element:concept-fe-disabled-2>disabled</a>, then the user agent should
- allow the user to <dfn id=concept-select-toggle>toggle</dfn> the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-11>selectedness</a> of the <code id=the-select-element:the-option-element-21><a href=#the-option-element>option</a></code> elements in
- its <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-14>list of options</a> that are themselves not <a href=#concept-option-disabled id=the-select-element:concept-option-disabled-3>disabled</a>. Upon such an element being <a href=#concept-select-toggle id=the-select-element:concept-select-toggle>toggled</a> (either through a click, or through a <a href=#using-the-option-element-to-define-a-command id=the-select-element:using-the-option-element-to-define-a-command-2>menu command</a>, or any other mechanism), and before the relevant user
- interaction event is queued (e.g. before a related <code id=the-select-element:event-click-3><a href=#event-click>click</a></code> event), the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-12>selectedness</a> of the <code id=the-select-element:the-option-element-22><a href=#the-option-element>option</a></code> element must
+ allow the user to <dfn id=concept-select-toggle>toggle</dfn> the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-14>selectedness</a> of the <code id=the-select-element:the-option-element-23><a href=#the-option-element>option</a></code> elements in
+ its <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-16>list of options</a> that are themselves not <a href=#concept-option-disabled id=the-select-element:concept-option-disabled-3>disabled</a>. Upon such an element being <a href=#concept-select-toggle id=the-select-element:concept-select-toggle>toggled</a> (either through a click, or through a <a href=#using-the-option-element-to-define-a-command id=the-select-element:using-the-option-element-to-define-a-command-2>menu command</a>, or any other mechanism), and before the relevant user
+ interaction event is queued (e.g. before a related <code id=the-select-element:event-click-3><a href=#event-click>click</a></code> event), the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-15>selectedness</a> of the <code id=the-select-element:the-option-element-24><a href=#the-option-element>option</a></code> element must
be changed (from true to false or false to true), the <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-3>dirtiness</a> of the element must be set to true, and the
user agent must <a href=#send-select-update-notifications id=the-select-element:send-select-update-notifications-3>send <code>select</code> update notifications</a>.</p>
<p>When the user agent is to <dfn id=send-select-update-notifications>send <code>select</code> update notifications</dfn>, <a href=#queue-a-task id=the-select-element:queue-a-task>queue
- a task</a> to first <a href=#fire-a-simple-event id=the-select-element:fire-a-simple-event>fire a simple event</a> that bubbles named <code id=the-select-element:event-input><a href=#event-input>input</a></code> at the <code id=the-select-element:the-select-element-21><a href=#the-select-element>select</a></code> element, and then <a href=#fire-a-simple-event id=the-select-element:fire-a-simple-event-2>fire a simple
+ a task</a> to first <a href=#fire-a-simple-event id=the-select-element:fire-a-simple-event>fire a simple event</a> that bubbles named <code id=the-select-element:event-input><a href=#event-input>input</a></code> at the <code id=the-select-element:the-select-element-22><a href=#the-select-element>select</a></code> element, and then <a href=#fire-a-simple-event id=the-select-element:fire-a-simple-event-2>fire a simple
event</a> that bubbles named <code id=the-select-element:event-change><a href=#event-change>change</a></code> at the
- <code id=the-select-element:the-select-element-22><a href=#the-select-element>select</a></code> element, using the <a href=#user-interaction-task-source id=the-select-element:user-interaction-task-source>user interaction task source</a> as the task
+ <code id=the-select-element:the-select-element-23><a href=#the-select-element>select</a></code> element, using the <a href=#user-interaction-task-source id=the-select-element:user-interaction-task-source>user interaction task source</a> as the task
source.</p>
- <p>The <a href=#concept-form-reset-control id=the-select-element:concept-form-reset-control>reset algorithm</a> for <code id=the-select-element:the-select-element-23><a href=#the-select-element>select</a></code>
- elements is to go through all the <code id=the-select-element:the-option-element-23><a href=#the-option-element>option</a></code> elements in the element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-15>list of options</a>, set their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-13>selectedness</a> to true if the <code id=the-select-element:the-option-element-24><a href=#the-option-element>option</a></code>
+ <p>The <a href=#concept-form-reset-control id=the-select-element:concept-form-reset-control>reset algorithm</a> for <code id=the-select-element:the-select-element-24><a href=#the-select-element>select</a></code>
+ elements is to go through all the <code id=the-select-element:the-option-element-25><a href=#the-option-element>option</a></code> elements in the element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-17>list of options</a>, set their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-16>selectedness</a> to true if the <code id=the-select-element:the-option-element-26><a href=#the-option-element>option</a></code>
element has a <code id=the-select-element:attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute, and false otherwise,
set their <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-4>dirtiness</a> to false, and then have the
- <code id=the-select-element:the-option-element-25><a href=#the-option-element>option</a></code> elements <a href=#ask-for-a-reset id=the-select-element:ask-for-a-reset>ask for a reset</a>.</p>
+ <code id=the-select-element:the-option-element-27><a href=#the-option-element>option</a></code> elements <a href=#ask-for-a-reset id=the-select-element:ask-for-a-reset>ask for a reset</a>.</p>
<p>
- The <code id=the-select-element:attr-fae-form-2><a href=#attr-fae-form>form</a></code> attribute is used to explicitly associate the <code id=the-select-element:the-select-element-24><a href=#the-select-element>select</a></code> element with its <a href=#form-owner id=the-select-element:form-owner>form owner</a>.
+ The <code id=the-select-element:attr-fae-form-2><a href=#attr-fae-form>form</a></code> attribute is used to explicitly associate the <code id=the-select-element:the-select-element-25><a href=#the-select-element>select</a></code> element with its <a href=#form-owner id=the-select-element:form-owner>form owner</a>.
The <code id=the-select-element:attr-fe-name-2><a href=#attr-fe-name>name</a></code> attribute represents the element's name.
The <code id=the-select-element:attr-fe-disabled-2><a href=#attr-fe-disabled>disabled</a></code> attribute is used to make the control non-interactive and to prevent its value from being submitted.
The <code id=the-select-element:attr-fe-autofocus-2><a href=#attr-fe-autofocus>autofocus</a></code> attribute controls focus.
The <code id=the-select-element:attr-fe-autocomplete-2><a href=#attr-fe-autocomplete>autocomplete</a></code> attribute controls how the user agent provides autofill behavior.
</p>
- <p>A <code id=the-select-element:the-select-element-25><a href=#the-select-element>select</a></code> element that is not <a href=#concept-fe-disabled id=the-select-element:concept-fe-disabled-3>disabled</a> is
+ <p>A <code id=the-select-element:the-select-element-26><a href=#the-select-element>select</a></code> element that is not <a href=#concept-fe-disabled id=the-select-element:concept-fe-disabled-3>disabled</a> is
<i id=the-select-element:concept-fe-mutable><a href=#concept-fe-mutable>mutable</a></i>.</p>
@@ -37417,27 +37422,27 @@
<dt><var>select</var> . <code id=the-select-element:dom-select-options-2><a href=#dom-select-options>options</a></code><dd>
- <p>Returns an <code id=the-select-element:htmloptionscollection-2-2><a href=#htmloptionscollection-2>HTMLOptionsCollection</a></code> of the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-16>list of options</a>.</p>
+ <p>Returns an <code id=the-select-element:htmloptionscollection-2-2><a href=#htmloptionscollection-2>HTMLOptionsCollection</a></code> of the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-18>list of options</a>.</p>
<dt><var>select</var> . <code id=the-select-element:dom-select-length-2><a href=#dom-select-length>length</a></code> [ = <var>value</var> ]<dd>
- <p>Returns the number of elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-17>list of
+ <p>Returns the number of elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-19>list of
options</a>.</p>
- <p>When set to a smaller number, truncates the number of <code id=the-select-element:the-option-element-26><a href=#the-option-element>option</a></code> elements in the
- <code id=the-select-element:the-select-element-26><a href=#the-select-element>select</a></code>.</p>
-
- <p>When set to a greater number, adds new blank <code id=the-select-element:the-option-element-27><a href=#the-option-element>option</a></code> elements to the
+ <p>When set to a smaller number, truncates the number of <code id=the-select-element:the-option-element-28><a href=#the-option-element>option</a></code> elements in the
<code id=the-select-element:the-select-element-27><a href=#the-select-element>select</a></code>.</p>
+ <p>When set to a greater number, adds new blank <code id=the-select-element:the-option-element-29><a href=#the-option-element>option</a></code> elements to the
+ <code id=the-select-element:the-select-element-28><a href=#the-select-element>select</a></code>.</p>
+
<dt><var>element</var> = <var>select</var> . <code id=the-select-element:dom-select-item-2><a href=#dom-select-item>item</a></code>(<var>index</var>)<dt><var>select</var>[<var>index</var>]<dd>
- <p>Returns the item with index <var>index</var> from the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-18>list of options</a>. The items are sorted in <a href=#tree-order id=the-select-element:tree-order-3>tree
+ <p>Returns the item with index <var>index</var> from the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-20>list of options</a>. The items are sorted in <a href=#tree-order id=the-select-element:tree-order-4>tree
order</a>.</p>
<dt><var>element</var> = <var>select</var> . <code id=the-select-element:dom-select-nameditem-2><a href=#dom-select-nameditem>namedItem</a></code>(<var>name</var>)<dd>
- <p>Returns the first item with <a href=#concept-id id=the-select-element:concept-id>ID</a> or <code id=the-select-element:attr-option-name><a href=#attr-option-name>name</a></code> <var>name</var> from the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-19>list of options</a>.</p>
+ <p>Returns the first item with <a href=#concept-id id=the-select-element:concept-id>ID</a> or <code id=the-select-element:attr-option-name><a href=#attr-option-name>name</a></code> <var>name</var> from the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-21>list of options</a>.</p>
<p>Returns null if no element with that <a href=#concept-id id=the-select-element:concept-id-2>ID</a> could be found.</p>
@@ -37446,7 +37451,7 @@
<p>Inserts <var>element</var> before the node given by <var>before</var>.</p>
<p>The <var>before</var> argument can be a number, in which case <var>element</var> is inserted before the item with that number, or an element from the
- <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-20>list of options</a>, in which case <var>element</var> is inserted before that element.</p>
+ <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-22>list of options</a>, in which case <var>element</var> is inserted before that element.</p>
<p>If <var>before</var> is omitted, null, or a number out of range, then <var>element</var> will be added at the end of the list.</p>
@@ -37454,7 +37459,7 @@
<dt><var>select</var> . <code id=the-select-element:dom-select-selectedoptions-2><a href=#dom-select-selectedoptions>selectedOptions</a></code><dd>
- <p>Returns an <code id=the-select-element:htmlcollection-2><a href=#htmlcollection>HTMLCollection</a></code> of the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-21>list
+ <p>Returns an <code id=the-select-element:htmlcollection-2><a href=#htmlcollection>HTMLCollection</a></code> of the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-23>list
of options</a> that are selected.</p>
<dt><var>select</var> . <code id=the-select-element:dom-select-selectedindex-2><a href=#dom-select-selectedindex>selectedIndex</a></code> [ = <var>value</var> ]<dd>
@@ -37480,8 +37485,8 @@
attribute is present.</p>
<p>The <dfn id=dom-select-options><code>options</code></dfn> IDL attribute must return an
- <code id=the-select-element:htmloptionscollection-2-3><a href=#htmloptionscollection-2>HTMLOptionsCollection</a></code> rooted at the <code id=the-select-element:the-select-element-28><a href=#the-select-element>select</a></code> node, whose filter matches
- the elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-22>list of options</a>.</p>
+ <code id=the-select-element:htmloptionscollection-2-3><a href=#htmloptionscollection-2>HTMLOptionsCollection</a></code> rooted at the <code id=the-select-element:the-select-element-29><a href=#the-select-element>select</a></code> node, whose filter matches
+ the elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-24>list of options</a>.</p>
<p>The <code id=the-select-element:dom-select-options-3><a href=#dom-select-options>options</a></code> collection is also mirrored on the
<code id=the-select-element:htmlselectelement><a href=#htmlselectelement>HTMLSelectElement</a></code> object. The <a href=#supported-property-indices id=the-select-element:supported-property-indices>supported property indices</a> at any instant
@@ -37517,42 +37522,42 @@
arguments.</p>
<p>The <dfn id=dom-select-selectedoptions><code>selectedOptions</code></dfn> IDL attribute
- must return an <code id=the-select-element:htmlcollection-3><a href=#htmlcollection>HTMLCollection</a></code> rooted at the <code id=the-select-element:the-select-element-29><a href=#the-select-element>select</a></code> node, whose filter
- matches the elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-23>list of options</a> that
- have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-14>selectedness</a> set to true.</p>
+ must return an <code id=the-select-element:htmlcollection-3><a href=#htmlcollection>HTMLCollection</a></code> rooted at the <code id=the-select-element:the-select-element-30><a href=#the-select-element>select</a></code> node, whose filter
+ matches the elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-25>list of options</a> that
+ have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-17>selectedness</a> set to true.</p>
<p>The <dfn id=dom-select-selectedindex><code>selectedIndex</code></dfn> IDL attribute, on
getting, must return the <a href=#concept-option-index id=the-select-element:concept-option-index>index</a> of the first
- <code id=the-select-element:the-option-element-28><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-24>list of
- options</a> in <a href=#tree-order id=the-select-element:tree-order-4>tree order</a> that has its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-15>selectedness</a> set to true, if any. If there isn't one,
+ <code id=the-select-element:the-option-element-30><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-26>list of
+ options</a> in <a href=#tree-order id=the-select-element:tree-order-5>tree order</a> that has its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-18>selectedness</a> set to true, if any. If there isn't one,
then it must return −1.</p>
<p>On setting, the <code id=the-select-element:dom-select-selectedindex-3><a href=#dom-select-selectedindex>selectedIndex</a></code> attribute must set
- the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-16>selectedness</a> of all the <code id=the-select-element:the-option-element-29><a href=#the-option-element>option</a></code>
- elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-25>list of options</a> to false, and
- then the <code id=the-select-element:the-option-element-30><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-26>list of
+ the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-19>selectedness</a> of all the <code id=the-select-element:the-option-element-31><a href=#the-option-element>option</a></code>
+ elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-27>list of options</a> to false, and
+ then the <code id=the-select-element:the-option-element-32><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-28>list of
options</a> whose <a href=#concept-option-index id=the-select-element:concept-option-index-2>index</a> is the given new value, if
- any, must have its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-17>selectedness</a> set to true and
+ any, must have its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-20>selectedness</a> set to true and
its <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-5>dirtiness</a> set to true.</p>
- <p class=note>This can result in no element having a <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-18>selectedness</a> set to true even in the case of the
- <code id=the-select-element:the-select-element-30><a href=#the-select-element>select</a></code> element having no <code id=the-select-element:attr-select-multiple-13><a href=#attr-select-multiple>multiple</a></code>
+ <p class=note>This can result in no element having a <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-21>selectedness</a> set to true even in the case of the
+ <code id=the-select-element:the-select-element-31><a href=#the-select-element>select</a></code> element having no <code id=the-select-element:attr-select-multiple-13><a href=#attr-select-multiple>multiple</a></code>
attribute and a <a href=#concept-select-size id=the-select-element:concept-select-size-6>display size</a> of 1.</p>
<p>The <dfn id=dom-select-value><code>value</code></dfn> IDL attribute, on getting, must
- return the <a href=#concept-option-value id=the-select-element:concept-option-value-3>value</a> of the first <code id=the-select-element:the-option-element-31><a href=#the-option-element>option</a></code>
- element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-27>list of options</a> in <a href=#tree-order id=the-select-element:tree-order-5>tree
- order</a> that has its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-19>selectedness</a> set to
+ return the <a href=#concept-option-value id=the-select-element:concept-option-value-3>value</a> of the first <code id=the-select-element:the-option-element-33><a href=#the-option-element>option</a></code>
+ element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-29>list of options</a> in <a href=#tree-order id=the-select-element:tree-order-6>tree
+ order</a> that has its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-22>selectedness</a> set to
true, if any. If there isn't one, then it must return the empty string.</p>
- <p>On setting, the <code id=the-select-element:dom-select-value-3><a href=#dom-select-value>value</a></code> attribute must set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-20>selectedness</a> of all the <code id=the-select-element:the-option-element-32><a href=#the-option-element>option</a></code> elements
- in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-28>list of options</a> to false, and then the
- first <code id=the-select-element:the-option-element-33><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-29>list of
- options</a>, in <a href=#tree-order id=the-select-element:tree-order-6>tree order</a>, whose <a href=#concept-option-value id=the-select-element:concept-option-value-4>value</a>
- is equal to the given new value, if any, must have its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-21>selectedness</a> set to true and its <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-6>dirtiness</a> set to true.</p>
+ <p>On setting, the <code id=the-select-element:dom-select-value-3><a href=#dom-select-value>value</a></code> attribute must set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-23>selectedness</a> of all the <code id=the-select-element:the-option-element-34><a href=#the-option-element>option</a></code> elements
+ in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-30>list of options</a> to false, and then the
+ first <code id=the-select-element:the-option-element-35><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-31>list of
+ options</a>, in <a href=#tree-order id=the-select-element:tree-order-7>tree order</a>, whose <a href=#concept-option-value id=the-select-element:concept-option-value-4>value</a>
+ is equal to the given new value, if any, must have its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-24>selectedness</a> set to true and its <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-6>dirtiness</a> set to true.</p>
- <p class=note>This can result in no element having a <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-22>selectedness</a> set to true even in the case of the
- <code id=the-select-element:the-select-element-31><a href=#the-select-element>select</a></code> element having no <code id=the-select-element:attr-select-multiple-14><a href=#attr-select-multiple>multiple</a></code>
+ <p class=note>This can result in no element having a <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-25>selectedness</a> set to true even in the case of the
+ <code id=the-select-element:the-select-element-32><a href=#the-select-element>select</a></code> element having no <code id=the-select-element:attr-select-multiple-14><a href=#attr-select-multiple>multiple</a></code>
attribute and a <a href=#concept-select-size id=the-select-element:concept-select-size-7>display size</a> of 1.</p>
<p>The <dfn id=dom-select-multiple><code>multiple</code></dfn>, <dfn id=dom-select-required><code>required</code></dfn>, and <dfn id=dom-select-size><code>size</code></dfn> IDL attributes must <a href=#reflect id=the-select-element:reflect>reflect</a> the
@@ -37574,7 +37579,7 @@
<div class=example>
- <p>The following example shows how a <code id=the-select-element:the-select-element-32><a href=#the-select-element>select</a></code> element can be used to offer the user
+ <p>The following example shows how a <code id=the-select-element:the-select-element-33><a href=#the-select-element>select</a></code> element can be used to offer the user
with a set of options from which the user can select a single option. The default option is
preselected.</p>
Modified: index
===================================================================
--- index 2014-08-06 18:26:29 UTC (rev 8713)
+++ index 2014-08-06 23:12:05 UTC (rev 8714)
@@ -37368,45 +37368,50 @@
<p>If <a href=#nodes-are-inserted id=the-select-element:nodes-are-inserted>nodes are inserted</a> or <a href=#nodes-are-removed id=the-select-element:nodes-are-removed>nodes are removed</a> causing the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-10>list of options</a> to gain or lose one or more
<code id=the-select-element:the-option-element-17><a href=#the-option-element>option</a></code> elements, or if an <code id=the-select-element:the-option-element-18><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-11>list of options</a> <dfn id=ask-for-a-reset>asks for
- a reset</dfn>, then, if the <code id=the-select-element:the-select-element-18><a href=#the-select-element>select</a></code> element's <code id=the-select-element:attr-select-multiple-8><a href=#attr-select-multiple>multiple</a></code> attribute is absent, the <code id=the-select-element:the-select-element-19><a href=#the-select-element>select</a></code>
- element's <a href=#concept-select-size id=the-select-element:concept-select-size-5>display size</a> is 1, and no <code id=the-select-element:the-option-element-19><a href=#the-option-element>option</a></code>
- elements in the <code id=the-select-element:the-select-element-20><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-12>list of
- options</a> have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-9>selectedness</a> set to
- true, the user agent must set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-10>selectedness</a>
- of the first <code id=the-select-element:the-option-element-20><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-13>list of
- options</a> in <a href=#tree-order id=the-select-element:tree-order-2>tree order</a> that is not <a href=#concept-option-disabled id=the-select-element:concept-option-disabled-2>disabled</a>, if any, to true.</p>
+ a reset</dfn>, then, if the <code id=the-select-element:the-select-element-18><a href=#the-select-element>select</a></code> element's <code id=the-select-element:attr-select-multiple-8><a href=#attr-select-multiple>multiple</a></code> attribute is absent, the user agent must run the
+ first applicable set of steps from the following list:</p>
+ <dl class=switch><dt>If the <code id=the-select-element:the-select-element-19><a href=#the-select-element>select</a></code>
+ element's <a href=#concept-select-size id=the-select-element:concept-select-size-5>display size</a> is 1, and no <code id=the-select-element:the-option-element-19><a href=#the-option-element>option</a></code>
+ elements in the <code id=the-select-element:the-select-element-20><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-12>list of
+ options</a> have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-9>selectedness</a> set to
+ true<dd><p>Set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-10>selectedness</a> of the first
+ <code id=the-select-element:the-option-element-20><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-13>list of
+ options</a> in <a href=#tree-order id=the-select-element:tree-order-2>tree order</a> that is not <a href=#concept-option-disabled id=the-select-element:concept-option-disabled-2>disabled</a>, if any, to true.<dt>If two or more <code id=the-select-element:the-option-element-21><a href=#the-option-element>option</a></code> elements in the <code id=the-select-element:the-select-element-21><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-14>list of options</a> have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-11>selectedness</a> set to true<dd><p>Set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-12>selectedness</a> of all but the last
+ <code id=the-select-element:the-option-element-22><a href=#the-option-element>option</a></code> element with its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-13>selectedness</a> set to true in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-15>list of options</a> in <a href=#tree-order id=the-select-element:tree-order-3>tree order</a> to
+ false.</dl>
+
<p>If the <code id=the-select-element:attr-select-multiple-9><a href=#attr-select-multiple>multiple</a></code> attribute is present, and the
element is not <a href=#concept-fe-disabled id=the-select-element:concept-fe-disabled-2>disabled</a>, then the user agent should
- allow the user to <dfn id=concept-select-toggle>toggle</dfn> the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-11>selectedness</a> of the <code id=the-select-element:the-option-element-21><a href=#the-option-element>option</a></code> elements in
- its <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-14>list of options</a> that are themselves not <a href=#concept-option-disabled id=the-select-element:concept-option-disabled-3>disabled</a>. Upon such an element being <a href=#concept-select-toggle id=the-select-element:concept-select-toggle>toggled</a> (either through a click, or through a <a href=#using-the-option-element-to-define-a-command id=the-select-element:using-the-option-element-to-define-a-command-2>menu command</a>, or any other mechanism), and before the relevant user
- interaction event is queued (e.g. before a related <code id=the-select-element:event-click-3><a href=#event-click>click</a></code> event), the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-12>selectedness</a> of the <code id=the-select-element:the-option-element-22><a href=#the-option-element>option</a></code> element must
+ allow the user to <dfn id=concept-select-toggle>toggle</dfn> the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-14>selectedness</a> of the <code id=the-select-element:the-option-element-23><a href=#the-option-element>option</a></code> elements in
+ its <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-16>list of options</a> that are themselves not <a href=#concept-option-disabled id=the-select-element:concept-option-disabled-3>disabled</a>. Upon such an element being <a href=#concept-select-toggle id=the-select-element:concept-select-toggle>toggled</a> (either through a click, or through a <a href=#using-the-option-element-to-define-a-command id=the-select-element:using-the-option-element-to-define-a-command-2>menu command</a>, or any other mechanism), and before the relevant user
+ interaction event is queued (e.g. before a related <code id=the-select-element:event-click-3><a href=#event-click>click</a></code> event), the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-15>selectedness</a> of the <code id=the-select-element:the-option-element-24><a href=#the-option-element>option</a></code> element must
be changed (from true to false or false to true), the <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-3>dirtiness</a> of the element must be set to true, and the
user agent must <a href=#send-select-update-notifications id=the-select-element:send-select-update-notifications-3>send <code>select</code> update notifications</a>.</p>
<p>When the user agent is to <dfn id=send-select-update-notifications>send <code>select</code> update notifications</dfn>, <a href=#queue-a-task id=the-select-element:queue-a-task>queue
- a task</a> to first <a href=#fire-a-simple-event id=the-select-element:fire-a-simple-event>fire a simple event</a> that bubbles named <code id=the-select-element:event-input><a href=#event-input>input</a></code> at the <code id=the-select-element:the-select-element-21><a href=#the-select-element>select</a></code> element, and then <a href=#fire-a-simple-event id=the-select-element:fire-a-simple-event-2>fire a simple
+ a task</a> to first <a href=#fire-a-simple-event id=the-select-element:fire-a-simple-event>fire a simple event</a> that bubbles named <code id=the-select-element:event-input><a href=#event-input>input</a></code> at the <code id=the-select-element:the-select-element-22><a href=#the-select-element>select</a></code> element, and then <a href=#fire-a-simple-event id=the-select-element:fire-a-simple-event-2>fire a simple
event</a> that bubbles named <code id=the-select-element:event-change><a href=#event-change>change</a></code> at the
- <code id=the-select-element:the-select-element-22><a href=#the-select-element>select</a></code> element, using the <a href=#user-interaction-task-source id=the-select-element:user-interaction-task-source>user interaction task source</a> as the task
+ <code id=the-select-element:the-select-element-23><a href=#the-select-element>select</a></code> element, using the <a href=#user-interaction-task-source id=the-select-element:user-interaction-task-source>user interaction task source</a> as the task
source.</p>
- <p>The <a href=#concept-form-reset-control id=the-select-element:concept-form-reset-control>reset algorithm</a> for <code id=the-select-element:the-select-element-23><a href=#the-select-element>select</a></code>
- elements is to go through all the <code id=the-select-element:the-option-element-23><a href=#the-option-element>option</a></code> elements in the element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-15>list of options</a>, set their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-13>selectedness</a> to true if the <code id=the-select-element:the-option-element-24><a href=#the-option-element>option</a></code>
+ <p>The <a href=#concept-form-reset-control id=the-select-element:concept-form-reset-control>reset algorithm</a> for <code id=the-select-element:the-select-element-24><a href=#the-select-element>select</a></code>
+ elements is to go through all the <code id=the-select-element:the-option-element-25><a href=#the-option-element>option</a></code> elements in the element's <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-17>list of options</a>, set their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-16>selectedness</a> to true if the <code id=the-select-element:the-option-element-26><a href=#the-option-element>option</a></code>
element has a <code id=the-select-element:attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute, and false otherwise,
set their <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-4>dirtiness</a> to false, and then have the
- <code id=the-select-element:the-option-element-25><a href=#the-option-element>option</a></code> elements <a href=#ask-for-a-reset id=the-select-element:ask-for-a-reset>ask for a reset</a>.</p>
+ <code id=the-select-element:the-option-element-27><a href=#the-option-element>option</a></code> elements <a href=#ask-for-a-reset id=the-select-element:ask-for-a-reset>ask for a reset</a>.</p>
<p>
- The <code id=the-select-element:attr-fae-form-2><a href=#attr-fae-form>form</a></code> attribute is used to explicitly associate the <code id=the-select-element:the-select-element-24><a href=#the-select-element>select</a></code> element with its <a href=#form-owner id=the-select-element:form-owner>form owner</a>.
+ The <code id=the-select-element:attr-fae-form-2><a href=#attr-fae-form>form</a></code> attribute is used to explicitly associate the <code id=the-select-element:the-select-element-25><a href=#the-select-element>select</a></code> element with its <a href=#form-owner id=the-select-element:form-owner>form owner</a>.
The <code id=the-select-element:attr-fe-name-2><a href=#attr-fe-name>name</a></code> attribute represents the element's name.
The <code id=the-select-element:attr-fe-disabled-2><a href=#attr-fe-disabled>disabled</a></code> attribute is used to make the control non-interactive and to prevent its value from being submitted.
The <code id=the-select-element:attr-fe-autofocus-2><a href=#attr-fe-autofocus>autofocus</a></code> attribute controls focus.
The <code id=the-select-element:attr-fe-autocomplete-2><a href=#attr-fe-autocomplete>autocomplete</a></code> attribute controls how the user agent provides autofill behavior.
</p>
- <p>A <code id=the-select-element:the-select-element-25><a href=#the-select-element>select</a></code> element that is not <a href=#concept-fe-disabled id=the-select-element:concept-fe-disabled-3>disabled</a> is
+ <p>A <code id=the-select-element:the-select-element-26><a href=#the-select-element>select</a></code> element that is not <a href=#concept-fe-disabled id=the-select-element:concept-fe-disabled-3>disabled</a> is
<i id=the-select-element:concept-fe-mutable><a href=#concept-fe-mutable>mutable</a></i>.</p>
@@ -37417,27 +37422,27 @@
<dt><var>select</var> . <code id=the-select-element:dom-select-options-2><a href=#dom-select-options>options</a></code><dd>
- <p>Returns an <code id=the-select-element:htmloptionscollection-2-2><a href=#htmloptionscollection-2>HTMLOptionsCollection</a></code> of the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-16>list of options</a>.</p>
+ <p>Returns an <code id=the-select-element:htmloptionscollection-2-2><a href=#htmloptionscollection-2>HTMLOptionsCollection</a></code> of the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-18>list of options</a>.</p>
<dt><var>select</var> . <code id=the-select-element:dom-select-length-2><a href=#dom-select-length>length</a></code> [ = <var>value</var> ]<dd>
- <p>Returns the number of elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-17>list of
+ <p>Returns the number of elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-19>list of
options</a>.</p>
- <p>When set to a smaller number, truncates the number of <code id=the-select-element:the-option-element-26><a href=#the-option-element>option</a></code> elements in the
- <code id=the-select-element:the-select-element-26><a href=#the-select-element>select</a></code>.</p>
-
- <p>When set to a greater number, adds new blank <code id=the-select-element:the-option-element-27><a href=#the-option-element>option</a></code> elements to the
+ <p>When set to a smaller number, truncates the number of <code id=the-select-element:the-option-element-28><a href=#the-option-element>option</a></code> elements in the
<code id=the-select-element:the-select-element-27><a href=#the-select-element>select</a></code>.</p>
+ <p>When set to a greater number, adds new blank <code id=the-select-element:the-option-element-29><a href=#the-option-element>option</a></code> elements to the
+ <code id=the-select-element:the-select-element-28><a href=#the-select-element>select</a></code>.</p>
+
<dt><var>element</var> = <var>select</var> . <code id=the-select-element:dom-select-item-2><a href=#dom-select-item>item</a></code>(<var>index</var>)<dt><var>select</var>[<var>index</var>]<dd>
- <p>Returns the item with index <var>index</var> from the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-18>list of options</a>. The items are sorted in <a href=#tree-order id=the-select-element:tree-order-3>tree
+ <p>Returns the item with index <var>index</var> from the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-20>list of options</a>. The items are sorted in <a href=#tree-order id=the-select-element:tree-order-4>tree
order</a>.</p>
<dt><var>element</var> = <var>select</var> . <code id=the-select-element:dom-select-nameditem-2><a href=#dom-select-nameditem>namedItem</a></code>(<var>name</var>)<dd>
- <p>Returns the first item with <a href=#concept-id id=the-select-element:concept-id>ID</a> or <code id=the-select-element:attr-option-name><a href=#attr-option-name>name</a></code> <var>name</var> from the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-19>list of options</a>.</p>
+ <p>Returns the first item with <a href=#concept-id id=the-select-element:concept-id>ID</a> or <code id=the-select-element:attr-option-name><a href=#attr-option-name>name</a></code> <var>name</var> from the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-21>list of options</a>.</p>
<p>Returns null if no element with that <a href=#concept-id id=the-select-element:concept-id-2>ID</a> could be found.</p>
@@ -37446,7 +37451,7 @@
<p>Inserts <var>element</var> before the node given by <var>before</var>.</p>
<p>The <var>before</var> argument can be a number, in which case <var>element</var> is inserted before the item with that number, or an element from the
- <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-20>list of options</a>, in which case <var>element</var> is inserted before that element.</p>
+ <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-22>list of options</a>, in which case <var>element</var> is inserted before that element.</p>
<p>If <var>before</var> is omitted, null, or a number out of range, then <var>element</var> will be added at the end of the list.</p>
@@ -37454,7 +37459,7 @@
<dt><var>select</var> . <code id=the-select-element:dom-select-selectedoptions-2><a href=#dom-select-selectedoptions>selectedOptions</a></code><dd>
- <p>Returns an <code id=the-select-element:htmlcollection-2><a href=#htmlcollection>HTMLCollection</a></code> of the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-21>list
+ <p>Returns an <code id=the-select-element:htmlcollection-2><a href=#htmlcollection>HTMLCollection</a></code> of the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-23>list
of options</a> that are selected.</p>
<dt><var>select</var> . <code id=the-select-element:dom-select-selectedindex-2><a href=#dom-select-selectedindex>selectedIndex</a></code> [ = <var>value</var> ]<dd>
@@ -37480,8 +37485,8 @@
attribute is present.</p>
<p>The <dfn id=dom-select-options><code>options</code></dfn> IDL attribute must return an
- <code id=the-select-element:htmloptionscollection-2-3><a href=#htmloptionscollection-2>HTMLOptionsCollection</a></code> rooted at the <code id=the-select-element:the-select-element-28><a href=#the-select-element>select</a></code> node, whose filter matches
- the elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-22>list of options</a>.</p>
+ <code id=the-select-element:htmloptionscollection-2-3><a href=#htmloptionscollection-2>HTMLOptionsCollection</a></code> rooted at the <code id=the-select-element:the-select-element-29><a href=#the-select-element>select</a></code> node, whose filter matches
+ the elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-24>list of options</a>.</p>
<p>The <code id=the-select-element:dom-select-options-3><a href=#dom-select-options>options</a></code> collection is also mirrored on the
<code id=the-select-element:htmlselectelement><a href=#htmlselectelement>HTMLSelectElement</a></code> object. The <a href=#supported-property-indices id=the-select-element:supported-property-indices>supported property indices</a> at any instant
@@ -37517,42 +37522,42 @@
arguments.</p>
<p>The <dfn id=dom-select-selectedoptions><code>selectedOptions</code></dfn> IDL attribute
- must return an <code id=the-select-element:htmlcollection-3><a href=#htmlcollection>HTMLCollection</a></code> rooted at the <code id=the-select-element:the-select-element-29><a href=#the-select-element>select</a></code> node, whose filter
- matches the elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-23>list of options</a> that
- have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-14>selectedness</a> set to true.</p>
+ must return an <code id=the-select-element:htmlcollection-3><a href=#htmlcollection>HTMLCollection</a></code> rooted at the <code id=the-select-element:the-select-element-30><a href=#the-select-element>select</a></code> node, whose filter
+ matches the elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-25>list of options</a> that
+ have their <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-17>selectedness</a> set to true.</p>
<p>The <dfn id=dom-select-selectedindex><code>selectedIndex</code></dfn> IDL attribute, on
getting, must return the <a href=#concept-option-index id=the-select-element:concept-option-index>index</a> of the first
- <code id=the-select-element:the-option-element-28><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-24>list of
- options</a> in <a href=#tree-order id=the-select-element:tree-order-4>tree order</a> that has its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-15>selectedness</a> set to true, if any. If there isn't one,
+ <code id=the-select-element:the-option-element-30><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-26>list of
+ options</a> in <a href=#tree-order id=the-select-element:tree-order-5>tree order</a> that has its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-18>selectedness</a> set to true, if any. If there isn't one,
then it must return −1.</p>
<p>On setting, the <code id=the-select-element:dom-select-selectedindex-3><a href=#dom-select-selectedindex>selectedIndex</a></code> attribute must set
- the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-16>selectedness</a> of all the <code id=the-select-element:the-option-element-29><a href=#the-option-element>option</a></code>
- elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-25>list of options</a> to false, and
- then the <code id=the-select-element:the-option-element-30><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-26>list of
+ the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-19>selectedness</a> of all the <code id=the-select-element:the-option-element-31><a href=#the-option-element>option</a></code>
+ elements in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-27>list of options</a> to false, and
+ then the <code id=the-select-element:the-option-element-32><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-28>list of
options</a> whose <a href=#concept-option-index id=the-select-element:concept-option-index-2>index</a> is the given new value, if
- any, must have its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-17>selectedness</a> set to true and
+ any, must have its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-20>selectedness</a> set to true and
its <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-5>dirtiness</a> set to true.</p>
- <p class=note>This can result in no element having a <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-18>selectedness</a> set to true even in the case of the
- <code id=the-select-element:the-select-element-30><a href=#the-select-element>select</a></code> element having no <code id=the-select-element:attr-select-multiple-13><a href=#attr-select-multiple>multiple</a></code>
+ <p class=note>This can result in no element having a <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-21>selectedness</a> set to true even in the case of the
+ <code id=the-select-element:the-select-element-31><a href=#the-select-element>select</a></code> element having no <code id=the-select-element:attr-select-multiple-13><a href=#attr-select-multiple>multiple</a></code>
attribute and a <a href=#concept-select-size id=the-select-element:concept-select-size-6>display size</a> of 1.</p>
<p>The <dfn id=dom-select-value><code>value</code></dfn> IDL attribute, on getting, must
- return the <a href=#concept-option-value id=the-select-element:concept-option-value-3>value</a> of the first <code id=the-select-element:the-option-element-31><a href=#the-option-element>option</a></code>
- element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-27>list of options</a> in <a href=#tree-order id=the-select-element:tree-order-5>tree
- order</a> that has its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-19>selectedness</a> set to
+ return the <a href=#concept-option-value id=the-select-element:concept-option-value-3>value</a> of the first <code id=the-select-element:the-option-element-33><a href=#the-option-element>option</a></code>
+ element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-29>list of options</a> in <a href=#tree-order id=the-select-element:tree-order-6>tree
+ order</a> that has its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-22>selectedness</a> set to
true, if any. If there isn't one, then it must return the empty string.</p>
- <p>On setting, the <code id=the-select-element:dom-select-value-3><a href=#dom-select-value>value</a></code> attribute must set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-20>selectedness</a> of all the <code id=the-select-element:the-option-element-32><a href=#the-option-element>option</a></code> elements
- in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-28>list of options</a> to false, and then the
- first <code id=the-select-element:the-option-element-33><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-29>list of
- options</a>, in <a href=#tree-order id=the-select-element:tree-order-6>tree order</a>, whose <a href=#concept-option-value id=the-select-element:concept-option-value-4>value</a>
- is equal to the given new value, if any, must have its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-21>selectedness</a> set to true and its <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-6>dirtiness</a> set to true.</p>
+ <p>On setting, the <code id=the-select-element:dom-select-value-3><a href=#dom-select-value>value</a></code> attribute must set the <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-23>selectedness</a> of all the <code id=the-select-element:the-option-element-34><a href=#the-option-element>option</a></code> elements
+ in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-30>list of options</a> to false, and then the
+ first <code id=the-select-element:the-option-element-35><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list id=the-select-element:concept-select-option-list-31>list of
+ options</a>, in <a href=#tree-order id=the-select-element:tree-order-7>tree order</a>, whose <a href=#concept-option-value id=the-select-element:concept-option-value-4>value</a>
+ is equal to the given new value, if any, must have its <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-24>selectedness</a> set to true and its <a href=#concept-option-dirtiness id=the-select-element:concept-option-dirtiness-6>dirtiness</a> set to true.</p>
- <p class=note>This can result in no element having a <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-22>selectedness</a> set to true even in the case of the
- <code id=the-select-element:the-select-element-31><a href=#the-select-element>select</a></code> element having no <code id=the-select-element:attr-select-multiple-14><a href=#attr-select-multiple>multiple</a></code>
+ <p class=note>This can result in no element having a <a href=#concept-option-selectedness id=the-select-element:concept-option-selectedness-25>selectedness</a> set to true even in the case of the
+ <code id=the-select-element:the-select-element-32><a href=#the-select-element>select</a></code> element having no <code id=the-select-element:attr-select-multiple-14><a href=#attr-select-multiple>multiple</a></code>
attribute and a <a href=#concept-select-size id=the-select-element:concept-select-size-7>display size</a> of 1.</p>
<p>The <dfn id=dom-select-multiple><code>multiple</code></dfn>, <dfn id=dom-select-required><code>required</code></dfn>, and <dfn id=dom-select-size><code>size</code></dfn> IDL attributes must <a href=#reflect id=the-select-element:reflect>reflect</a> the
@@ -37574,7 +37579,7 @@
<div class=example>
- <p>The following example shows how a <code id=the-select-element:the-select-element-32><a href=#the-select-element>select</a></code> element can be used to offer the user
+ <p>The following example shows how a <code id=the-select-element:the-select-element-33><a href=#the-select-element>select</a></code> element can be used to offer the user
with a set of options from which the user can select a single option. The default option is
preselected.</p>
Modified: source
===================================================================
--- source 2014-08-06 18:26:29 UTC (rev 8713)
+++ source 2014-08-06 23:12:05 UTC (rev 8714)
@@ -48017,15 +48017,34 @@
<code>option</code> elements, or if an <code>option</code> element in the <span
data-x="concept-select-option-list">list of options</span> <dfn data-x="ask for a reset">asks for
a reset</dfn>, then, if the <code>select</code> element's <code
- data-x="attr-select-multiple">multiple</code> attribute is absent, the <code>select</code>
- element's <span data-x="concept-select-size">display size</span> is 1, and no <code>option</code>
- elements in the <code>select</code> element's <span data-x="concept-select-option-list">list of
- options</span> have their <span data-x="concept-option-selectedness">selectedness</span> set to
- true, the user agent must set the <span data-x="concept-option-selectedness">selectedness</span>
- of the first <code>option</code> element in the <span data-x="concept-select-option-list">list of
- options</span> in <span>tree order</span> that is not <span
- data-x="concept-option-disabled">disabled</span>, if any, to true.</p>
+ data-x="attr-select-multiple">multiple</code> attribute is absent, the user agent must run the
+ first applicable set of steps from the following list:</p>
+ <dl class="switch">
+
+ <dt>If the <code>select</code>
+ element's <span data-x="concept-select-size">display size</span> is 1, and no <code>option</code>
+ elements in the <code>select</code> element's <span data-x="concept-select-option-list">list of
+ options</span> have their <span data-x="concept-option-selectedness">selectedness</span> set to
+ true</dt>
+
+ <dd><p>Set the <span data-x="concept-option-selectedness">selectedness</span> of the first
+ <code>option</code> element in the <span data-x="concept-select-option-list">list of
+ options</span> in <span>tree order</span> that is not <span
+ data-x="concept-option-disabled">disabled</span>, if any, to true.</p></dd>
+
+ <dt>If two or more <code>option</code> elements in the <code>select</code> element's <span
+ data-x="concept-select-option-list">list of options</span> have their <span
+ data-x="concept-option-selectedness">selectedness</span> set to true</dt>
+
+ <dd><p>Set the <span data-x="concept-option-selectedness">selectedness</span> of all but the last
+ <code>option</code> element with its <span
+ data-x="concept-option-selectedness">selectedness</span> set to true in the <span
+ data-x="concept-select-option-list">list of options</span> in <span>tree order</span> to
+ false.</p></dd>
+
+ </dl>
+
<p>If the <code data-x="attr-select-multiple">multiple</code> attribute is present, and the
element is not <span data-x="concept-fe-disabled">disabled</span>, then the user agent should
allow the user to <dfn data-x="concept-select-toggle">toggle</dfn> the <span
More information about the Commit-Watchers
mailing list