[html5] r7559 - [giow] (3) Try to clean up <option> element selectedness handling. Fixing https: [...]

whatwg at whatwg.org whatwg at whatwg.org
Sat Dec 1 16:46:44 PST 2012


Author: ianh
Date: 2012-12-01 16:46:43 -0800 (Sat, 01 Dec 2012)
New Revision: 7559

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Try to clean up <option> element selectedness handling.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=18946
Affected topics: DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2012-12-01 22:39:52 UTC (rev 7558)
+++ complete.html	2012-12-02 00:46:43 UTC (rev 7559)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 1 December 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 2 December 2012</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -51836,7 +51836,7 @@
   <code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> has its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true, and whenever an
   <code><a href=#the-option-element>option</a></code> element with its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a>
   set to true is added to the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, the user agent must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of all the other <code><a href=#the-option-element>option</a></code>
-  element in its <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false.</p>
+  elements in its <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false.</p>
 
   <p>If the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent and the element's
   <a href=#concept-select-size title=concept-select-size>display size</a> is greater than 1, then the user agent
@@ -51849,13 +51849,15 @@
   <code><a href=#the-select-element>select</a></code> element, using the <a href=#user-interaction-task-source>user interaction task source</a> as the task
   source.</p>
 
-  <p>If the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent and the element's
-  <a href=#concept-select-size title=concept-select-size>display size</a> is 1, then whenever there are no
-  <code><a href=#the-option-element>option</a></code> elements in the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> that have their <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true, the user agent must set the
-  <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of the first <code><a href=#the-option-element>option</a></code>
-  element in the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> in <a href=#tree-order>tree
-  order</a> that is not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, if any, to
-  true.</p>
+  <p>If <a href=#nodes-are-inserted>nodes are inserted</a> or <a href=#nodes-are-removed>nodes are removed</a> causing the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to gain or lose one or more
+  <code><a href=#the-option-element>option</a></code> elements, or if an <code><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> <dfn id=ask-for-a-reset title="ask for a reset">asks for a
+  reset</dfn>, then, if the <code><a href=#the-select-element>select</a></code> element's <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent, the <code><a href=#the-select-element>select</a></code>
+  element's <a href=#concept-select-size title=concept-select-size>display size</a> is 1, and no <code><a href=#the-option-element>option</a></code>
+  elements in the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of
+  options</a> have their <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
+  true, the user agent must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of
+  the first <code><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list title=concept-select-option-list>list of
+  options</a> in <a href=#tree-order>tree order</a> that is not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, if any, to true.</p>
 
   <p>If the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is present, and the element
   is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, then the user agent should allow the
@@ -51868,8 +51870,9 @@
   source.</p>
 
   <p>The <a href=#concept-form-reset-control title=concept-form-reset-control>reset algorithm</a> for <code><a href=#the-select-element>select</a></code>
-  elements is to go through all the <code><a href=#the-option-element>option</a></code> elements in the element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, and set their <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> to true if the <code><a href=#the-option-element>option</a></code> element
-  has a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute, and false otherwise.</p>
+  elements is to go through all the <code><a href=#the-option-element>option</a></code> elements in the element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, set their <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> to true if the <code><a href=#the-option-element>option</a></code> element
+  has a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute, and false otherwise, and then
+  have the <code><a href=#the-option-element>option</a></code> elements <a href=#ask-for-a-reset>ask for a reset</a>.</p>
 
   </div>
 
@@ -52030,6 +52033,10 @@
   options</a> whose <a href=#concept-option-index title=concept-option-index>index</a> is the given new value, if
   any, must have its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true.</p>
 
+  <p class=note>This can result in no element having a <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true even in the case of the
+  <code><a href=#the-select-element>select</a></code> element having no <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute
+  and a <a href=#concept-select-size title=concept-select-size>display size</a> of 1.</p>
+
   <p>The <dfn id=dom-select-value title=dom-select-value><code>value</code></dfn> IDL attribute, on getting, must
   return the <a href=#concept-option-value title=concept-option-value>value</a> of the first <code><a href=#the-option-element>option</a></code>
   element in the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> in <a href=#tree-order>tree
@@ -52042,6 +52049,10 @@
   options</a>, in <a href=#tree-order>tree order</a>, whose <a href=#concept-option-value title=concept-option-value>value</a>
   is equal to the given new value, if any, must have its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true.</p>
 
+  <p class=note>This can result in no element having a <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true even in the case of the
+  <code><a href=#the-select-element>select</a></code> element having no <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute
+  and a <a href=#concept-select-size title=concept-select-size>display size</a> of 1.</p>
+
   <p>The <dfn id=dom-select-multiple title=dom-select-multiple><code>multiple</code></dfn>, <dfn id=dom-select-required title=dom-select-required><code>required</code></dfn>, and <dfn id=dom-select-size title=dom-select-size><code>size</code></dfn> IDL attributes must <a href=#reflect>reflect</a> the
   respective content attributes of the same name. The <code title=dom-select-size><a href=#dom-select-size>size</a></code> IDL
   attribute has a default value of zero.</p> <!-- see bug 12288 for compat reasons why .size allows
@@ -52458,7 +52469,7 @@
   <p>The <dfn id=dom-option-selected title=dom-option-selected><code>selected</code></dfn>
   IDL attribute, on getting, must return true if the element's <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> is true, and
   false otherwise. On setting, it must set the element's <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> to the new
-  value.</p>
+  value, and then cause the element to <a href=#ask-for-a-reset>ask for a reset</a>.</p>
 
   <p>The <dfn id=dom-option-index title=dom-option-index><code>index</code></dfn> IDL
   attribute must return the element's <a href=#concept-option-index title=concept-option-index>index</a>.</p>

Modified: index
===================================================================
--- index	2012-12-01 22:39:52 UTC (rev 7558)
+++ index	2012-12-02 00:46:43 UTC (rev 7559)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 1 December 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 2 December 2012</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -51836,7 +51836,7 @@
   <code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> has its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true, and whenever an
   <code><a href=#the-option-element>option</a></code> element with its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a>
   set to true is added to the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, the user agent must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of all the other <code><a href=#the-option-element>option</a></code>
-  element in its <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false.</p>
+  elements in its <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false.</p>
 
   <p>If the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent and the element's
   <a href=#concept-select-size title=concept-select-size>display size</a> is greater than 1, then the user agent
@@ -51849,13 +51849,15 @@
   <code><a href=#the-select-element>select</a></code> element, using the <a href=#user-interaction-task-source>user interaction task source</a> as the task
   source.</p>
 
-  <p>If the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent and the element's
-  <a href=#concept-select-size title=concept-select-size>display size</a> is 1, then whenever there are no
-  <code><a href=#the-option-element>option</a></code> elements in the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> that have their <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true, the user agent must set the
-  <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of the first <code><a href=#the-option-element>option</a></code>
-  element in the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> in <a href=#tree-order>tree
-  order</a> that is not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, if any, to
-  true.</p>
+  <p>If <a href=#nodes-are-inserted>nodes are inserted</a> or <a href=#nodes-are-removed>nodes are removed</a> causing the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to gain or lose one or more
+  <code><a href=#the-option-element>option</a></code> elements, or if an <code><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> <dfn id=ask-for-a-reset title="ask for a reset">asks for a
+  reset</dfn>, then, if the <code><a href=#the-select-element>select</a></code> element's <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent, the <code><a href=#the-select-element>select</a></code>
+  element's <a href=#concept-select-size title=concept-select-size>display size</a> is 1, and no <code><a href=#the-option-element>option</a></code>
+  elements in the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of
+  options</a> have their <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
+  true, the user agent must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of
+  the first <code><a href=#the-option-element>option</a></code> element in the <a href=#concept-select-option-list title=concept-select-option-list>list of
+  options</a> in <a href=#tree-order>tree order</a> that is not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, if any, to true.</p>
 
   <p>If the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is present, and the element
   is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, then the user agent should allow the
@@ -51868,8 +51870,9 @@
   source.</p>
 
   <p>The <a href=#concept-form-reset-control title=concept-form-reset-control>reset algorithm</a> for <code><a href=#the-select-element>select</a></code>
-  elements is to go through all the <code><a href=#the-option-element>option</a></code> elements in the element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, and set their <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> to true if the <code><a href=#the-option-element>option</a></code> element
-  has a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute, and false otherwise.</p>
+  elements is to go through all the <code><a href=#the-option-element>option</a></code> elements in the element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, set their <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> to true if the <code><a href=#the-option-element>option</a></code> element
+  has a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute, and false otherwise, and then
+  have the <code><a href=#the-option-element>option</a></code> elements <a href=#ask-for-a-reset>ask for a reset</a>.</p>
 
   </div>
 
@@ -52030,6 +52033,10 @@
   options</a> whose <a href=#concept-option-index title=concept-option-index>index</a> is the given new value, if
   any, must have its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true.</p>
 
+  <p class=note>This can result in no element having a <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true even in the case of the
+  <code><a href=#the-select-element>select</a></code> element having no <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute
+  and a <a href=#concept-select-size title=concept-select-size>display size</a> of 1.</p>
+
   <p>The <dfn id=dom-select-value title=dom-select-value><code>value</code></dfn> IDL attribute, on getting, must
   return the <a href=#concept-option-value title=concept-option-value>value</a> of the first <code><a href=#the-option-element>option</a></code>
   element in the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> in <a href=#tree-order>tree
@@ -52042,6 +52049,10 @@
   options</a>, in <a href=#tree-order>tree order</a>, whose <a href=#concept-option-value title=concept-option-value>value</a>
   is equal to the given new value, if any, must have its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true.</p>
 
+  <p class=note>This can result in no element having a <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true even in the case of the
+  <code><a href=#the-select-element>select</a></code> element having no <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute
+  and a <a href=#concept-select-size title=concept-select-size>display size</a> of 1.</p>
+
   <p>The <dfn id=dom-select-multiple title=dom-select-multiple><code>multiple</code></dfn>, <dfn id=dom-select-required title=dom-select-required><code>required</code></dfn>, and <dfn id=dom-select-size title=dom-select-size><code>size</code></dfn> IDL attributes must <a href=#reflect>reflect</a> the
   respective content attributes of the same name. The <code title=dom-select-size><a href=#dom-select-size>size</a></code> IDL
   attribute has a default value of zero.</p> <!-- see bug 12288 for compat reasons why .size allows
@@ -52458,7 +52469,7 @@
   <p>The <dfn id=dom-option-selected title=dom-option-selected><code>selected</code></dfn>
   IDL attribute, on getting, must return true if the element's <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> is true, and
   false otherwise. On setting, it must set the element's <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> to the new
-  value.</p>
+  value, and then cause the element to <a href=#ask-for-a-reset>ask for a reset</a>.</p>
 
   <p>The <dfn id=dom-option-index title=dom-option-index><code>index</code></dfn> IDL
   attribute must return the element's <a href=#concept-option-index title=concept-option-index>index</a>.</p>

Modified: source
===================================================================
--- source	2012-12-01 22:39:52 UTC (rev 7558)
+++ source	2012-12-02 00:46:43 UTC (rev 7559)
@@ -60491,7 +60491,7 @@
   set to true is added to the <code>select</code> element's <span
   title="concept-select-option-list">list of options</span>, the user agent must set the <span
   title="concept-option-selectedness">selectedness</span> of all the other <code>option</code>
-  element in its <span title="concept-select-option-list">list of options</span> to false.</p>
+  elements in its <span title="concept-select-option-list">list of options</span> to false.</p>
 
   <p>If the <code title="attr-select-multiple">multiple</code> attribute is absent and the element's
   <span title="concept-select-size">display size</span> is greater than 1, then the user agent
@@ -60505,15 +60505,19 @@
   <code>select</code> element, using the <span>user interaction task source</span> as the task
   source.</p>
 
-  <p>If the <code title="attr-select-multiple">multiple</code> attribute is absent and the element's
-  <span title="concept-select-size">display size</span> is 1, then whenever there are no
-  <code>option</code> elements in the <code>select</code> element's <span
-  title="concept-select-option-list">list of options</span> that have their <span
-  title="concept-option-selectedness">selectedness</span> set to true, the user agent must set the
-  <span title="concept-option-selectedness">selectedness</span> of the first <code>option</code>
-  element in the <span title="concept-select-option-list">list of options</span> in <span>tree
-  order</span> that is not <span title="concept-option-disabled">disabled</span>, if any, to
-  true.</p>
+  <p>If <span>nodes are inserted</span> or <span>nodes are removed</span> causing the <span
+  title="concept-select-option-list">list of options</span> to gain or lose one or more
+  <code>option</code> elements, or if an <code>option</code> element in the <span
+  title="concept-select-option-list">list of options</span> <dfn title="ask for a reset">asks for a
+  reset</dfn>, then, if the <code>select</code> element's <code
+  title="attr-select-multiple">multiple</code> attribute is absent, the <code>select</code>
+  element's <span title="concept-select-size">display size</span> is 1, and no <code>option</code>
+  elements in the <code>select</code> element's <span title="concept-select-option-list">list of
+  options</span> have their <span title="concept-option-selectedness">selectedness</span> set to
+  true, the user agent must set the <span title="concept-option-selectedness">selectedness</span> of
+  the first <code>option</code> element in the <span title="concept-select-option-list">list of
+  options</span> in <span>tree order</span> that is not <span
+  title="concept-option-disabled">disabled</span>, if any, to true.</p>
 
   <p>If the <code title="attr-select-multiple">multiple</code> attribute is present, and the element
   is not <span title="concept-fe-disabled">disabled</span>, then the user agent should allow the
@@ -60532,9 +60536,10 @@
 
   <p>The <span title="concept-form-reset-control">reset algorithm</span> for <code>select</code>
   elements is to go through all the <code>option</code> elements in the element's <span
-  title="concept-select-option-list">list of options</span>, and set their <span
+  title="concept-select-option-list">list of options</span>, set their <span
   title="concept-option-selectedness">selectedness</span> to true if the <code>option</code> element
-  has a <code title="attr-option-selected">selected</code> attribute, and false otherwise.</p>
+  has a <code title="attr-option-selected">selected</code> attribute, and false otherwise, and then
+  have the <code>option</code> elements <span>ask for a reset</span>.</p>
 
   </div>
 
@@ -60719,6 +60724,11 @@
   options</span> whose <span title="concept-option-index">index</span> is the given new value, if
   any, must have its <span title="concept-option-selectedness">selectedness</span> set to true.</p>
 
+  <p class="note">This can result in no element having a <span
+  title="concept-option-selectedness">selectedness</span> set to true even in the case of the
+  <code>select</code> element having no <code title="attr-select-multiple">multiple</code> attribute
+  and a <span title="concept-select-size">display size</span> of 1.</p>
+
   <p>The <dfn title="dom-select-value"><code>value</code></dfn> IDL attribute, on getting, must
   return the <span title="concept-option-value">value</span> of the first <code>option</code>
   element in the <span title="concept-select-option-list">list of options</span> in <span>tree
@@ -60733,6 +60743,11 @@
   is equal to the given new value, if any, must have its <span
   title="concept-option-selectedness">selectedness</span> set to true.</p>
 
+  <p class="note">This can result in no element having a <span
+  title="concept-option-selectedness">selectedness</span> set to true even in the case of the
+  <code>select</code> element having no <code title="attr-select-multiple">multiple</code> attribute
+  and a <span title="concept-select-size">display size</span> of 1.</p>
+
   <p>The <dfn title="dom-select-multiple"><code>multiple</code></dfn>, <dfn
   title="dom-select-required"><code>required</code></dfn>, and <dfn
   title="dom-select-size"><code>size</code></dfn> IDL attributes must <span>reflect</span> the
@@ -61214,7 +61229,7 @@
   title="concept-option-selectedness">selectedness</span> is true, and
   false otherwise. On setting, it must set the element's <span
   title="concept-option-selectedness">selectedness</span> to the new
-  value.</p>
+  value, and then cause the element to <span>ask for a reset</span>.</p>
 
   <p>The <dfn title="dom-option-index"><code>index</code></dfn> IDL
   attribute must return the element's <span




More information about the Commit-Watchers mailing list