[html5] r8297 - [giow] (3) Move more towards the browsers for <option> selectedness vs dirtiness [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Nov 19 12:20:48 PST 2013


Author: ianh
Date: 2013-11-19 12:20:46 -0800 (Tue, 19 Nov 2013)
New Revision: 8297

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Move more towards the browsers for <option> selectedness vs dirtiness. This doesn't quite match any browser exactly, so all browsers would have to change to match it. If there's a reason (e.g. backcompat) to prefer a different model, please reopen the bug and let me know.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=23574
Affected topics: DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2013-11-19 00:23:06 UTC (rev 8296)
+++ complete.html	2013-11-19 20:20:46 UTC (rev 8297)
@@ -43825,6 +43825,7 @@
 
   <div class=impl>
 
+<!--CLEANUP-->
   <p>If the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent, and the element
   is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, then the user agent should allow the
   user to pick an <code><a href=#the-option-element>option</a></code> element in its <a href=#concept-select-option-list title=concept-select-option-list>list
@@ -43833,7 +43834,7 @@
   through a click, or through unfocusing the element after changing its value, or through a <a href=#using-the-option-element-to-define-a-command title=option-command>menu command</a>, or through any other mechanism), and before the
   relevant user interaction event <!-- interaction event spec point --> is queued (e.g. before the
   <code title=event-click><a href=#event-click>click</a></code> event), the user agent must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of the picked <code><a href=#the-option-element>option</a></code> element
-  to true and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> that bubbles named
+  to true, set its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> to true, and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> that bubbles named
   <code title=event-change>change</code> at the <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>
 
@@ -43843,13 +43844,14 @@
   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>
   elements in its <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false.</p>
 
+<!--CLEANUP-->
   <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
   should also allow the user to request that the <code><a href=#the-option-element>option</a></code> whose <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> is true, if any, be unselected. Upon this
   request being conveyed to the user agent, and before the relevant user interaction event <!--
   interaction event spec point --> is queued (e.g. before the <code title=event-click><a href=#event-click>click</a></code>
   event), the user agent must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a>
-  of that <code><a href=#the-option-element>option</a></code> element to false and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+  of that <code><a href=#the-option-element>option</a></code> element to false, set its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> to true, and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
   simple event</a> that bubbles named <code title=event-change>change</code> at the
   <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>
@@ -43864,19 +43866,21 @@
   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>
 
+<!--CLEANUP-->
   <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
   user to <dfn id=concept-select-toggle title=concept-select-toggle>toggle</dfn> the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of the <code><a href=#the-option-element>option</a></code> elements in its
-  <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> that are themselves not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a> (either through a click, or through a <a href=#using-the-option-element-to-define-a-command title=option-command>menu command</a>, or any other mechanism). Upon the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of one or more <code><a href=#the-option-element>option</a></code>
-  elements being changed by the user, and before the relevant user interaction event <!--
-  interaction event spec point --> is queued (e.g. before a related <code title=event-click><a href=#event-click>click</a></code> event), the user agent must <a href=#queue-a-task>queue a task</a> to
+  <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> that are themselves not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>. Upon such an element being <a href=#concept-select-toggle title=concept-select-toggle>toggled</a> (either through a click, or through a <a href=#using-the-option-element-to-define-a-command title=option-command>menu command</a>, or any other mechanism), and before the relevant user interaction event <!--
+  interaction event spec point --> is queued (e.g. before a related <code title=event-click><a href=#event-click>click</a></code> event), the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of the <code><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 title=concept-option-dirtiness>dirtiness</a> of the element must be set to true, and the user agent must <a href=#queue-a-task>queue a task</a> to
   <a href=#fire-a-simple-event>fire a simple event</a> that bubbles named <code title=event-change>change</code> at
   the <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>
 
+<!--CLEANUP-->
   <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>, 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
+  has a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute, and false otherwise, set their <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> to false, 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>
@@ -44038,12 +44042,13 @@
   in <a href=#tree-order>tree order</a> that has its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true, if any. If there isn't one,
   then it must return −1.</p>
 
+<!--CLEANUP-->
   <p>On setting, the <code title=dom-select-selectedIndex><a href=#dom-select-selectedindex>selectedIndex</a></code> attribute must set
   the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of all the <code><a href=#the-option-element>option</a></code>
   elements in the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false, and then
   the <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> 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>
+  any, must have its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true and its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</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
@@ -44055,11 +44060,12 @@
   order</a> that has its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
   true, if any. If there isn't one, then it must return the empty string.</p>
 
+<!--CLEANUP-->
   <p>On setting, the <code title=dom-select-value><a href=#dom-select-value>value</a></code> attribute must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of all the <code><a href=#the-option-element>option</a></code> elements in
   the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false, and then 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>, 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>
+  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 and its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</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
@@ -44412,12 +44418,19 @@
 
   <div class=impl>
 
+  <p>The <dfn id=concept-option-dirtiness title=concept-option-dirtiness>dirtiness</dfn> of an <code><a href=#the-option-element>option</a></code> element is
+  a boolean state, initially false. It controls whether adding or removing the <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> content attribute has any effect.</p>
+
+<!--CLEANUP-->
   <p>The <dfn id=concept-option-selectedness title=concept-option-selectedness>selectedness</dfn> of an <code><a href=#the-option-element>option</a></code>
   element is a boolean state, initially false. Except where otherwise specified, when the element is
   created, its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set to true if
   the element has a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute. Whenever an
   <code><a href=#the-option-element>option</a></code> element's <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute is
-  added, its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set to true.</p>
+  added, if its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> is true, its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set to true.
+  Whenever an
+  <code><a href=#the-option-element>option</a></code> element's <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute is
+  <em>removed</em>, if its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> is true, its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set to false.</p>
 
   <p class=note>The <code title=dom-option><a href=#dom-option>Option()</a></code> constructor, when called with three
   or fewer arguments, overrides the initial state of the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> state to always be false even if the third
@@ -44510,9 +44523,10 @@
   return the element's <a href=#concept-option-value title=concept-option-value>value</a>. On setting, the element's
   <code title=attr-option-value><a href=#attr-option-value>value</a></code> content attribute must be set to the new value.</p>
 
+<!--CLEANUP-->
   <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, and then cause the
+  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, set its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> to true, 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

Modified: index
===================================================================
--- index	2013-11-19 00:23:06 UTC (rev 8296)
+++ index	2013-11-19 20:20:46 UTC (rev 8297)
@@ -43825,6 +43825,7 @@
 
   <div class=impl>
 
+<!--CLEANUP-->
   <p>If the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent, and the element
   is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, then the user agent should allow the
   user to pick an <code><a href=#the-option-element>option</a></code> element in its <a href=#concept-select-option-list title=concept-select-option-list>list
@@ -43833,7 +43834,7 @@
   through a click, or through unfocusing the element after changing its value, or through a <a href=#using-the-option-element-to-define-a-command title=option-command>menu command</a>, or through any other mechanism), and before the
   relevant user interaction event <!-- interaction event spec point --> is queued (e.g. before the
   <code title=event-click><a href=#event-click>click</a></code> event), the user agent must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of the picked <code><a href=#the-option-element>option</a></code> element
-  to true and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> that bubbles named
+  to true, set its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> to true, and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> that bubbles named
   <code title=event-change>change</code> at the <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>
 
@@ -43843,13 +43844,14 @@
   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>
   elements in its <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false.</p>
 
+<!--CLEANUP-->
   <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
   should also allow the user to request that the <code><a href=#the-option-element>option</a></code> whose <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> is true, if any, be unselected. Upon this
   request being conveyed to the user agent, and before the relevant user interaction event <!--
   interaction event spec point --> is queued (e.g. before the <code title=event-click><a href=#event-click>click</a></code>
   event), the user agent must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a>
-  of that <code><a href=#the-option-element>option</a></code> element to false and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
+  of that <code><a href=#the-option-element>option</a></code> element to false, set its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> to true, and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
   simple event</a> that bubbles named <code title=event-change>change</code> at the
   <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>
@@ -43864,19 +43866,21 @@
   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>
 
+<!--CLEANUP-->
   <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
   user to <dfn id=concept-select-toggle title=concept-select-toggle>toggle</dfn> the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of the <code><a href=#the-option-element>option</a></code> elements in its
-  <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> that are themselves not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a> (either through a click, or through a <a href=#using-the-option-element-to-define-a-command title=option-command>menu command</a>, or any other mechanism). Upon the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of one or more <code><a href=#the-option-element>option</a></code>
-  elements being changed by the user, and before the relevant user interaction event <!--
-  interaction event spec point --> is queued (e.g. before a related <code title=event-click><a href=#event-click>click</a></code> event), the user agent must <a href=#queue-a-task>queue a task</a> to
+  <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> that are themselves not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>. Upon such an element being <a href=#concept-select-toggle title=concept-select-toggle>toggled</a> (either through a click, or through a <a href=#using-the-option-element-to-define-a-command title=option-command>menu command</a>, or any other mechanism), and before the relevant user interaction event <!--
+  interaction event spec point --> is queued (e.g. before a related <code title=event-click><a href=#event-click>click</a></code> event), the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of the <code><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 title=concept-option-dirtiness>dirtiness</a> of the element must be set to true, and the user agent must <a href=#queue-a-task>queue a task</a> to
   <a href=#fire-a-simple-event>fire a simple event</a> that bubbles named <code title=event-change>change</code> at
   the <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>
 
+<!--CLEANUP-->
   <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>, 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
+  has a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute, and false otherwise, set their <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> to false, 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>
@@ -44038,12 +44042,13 @@
   in <a href=#tree-order>tree order</a> that has its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true, if any. If there isn't one,
   then it must return −1.</p>
 
+<!--CLEANUP-->
   <p>On setting, the <code title=dom-select-selectedIndex><a href=#dom-select-selectedindex>selectedIndex</a></code> attribute must set
   the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of all the <code><a href=#the-option-element>option</a></code>
   elements in the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false, and then
   the <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> 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>
+  any, must have its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true and its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</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
@@ -44055,11 +44060,12 @@
   order</a> that has its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
   true, if any. If there isn't one, then it must return the empty string.</p>
 
+<!--CLEANUP-->
   <p>On setting, the <code title=dom-select-value><a href=#dom-select-value>value</a></code> attribute must set the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> of all the <code><a href=#the-option-element>option</a></code> elements in
   the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> to false, and then 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>, 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>
+  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 and its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</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
@@ -44412,12 +44418,19 @@
 
   <div class=impl>
 
+  <p>The <dfn id=concept-option-dirtiness title=concept-option-dirtiness>dirtiness</dfn> of an <code><a href=#the-option-element>option</a></code> element is
+  a boolean state, initially false. It controls whether adding or removing the <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> content attribute has any effect.</p>
+
+<!--CLEANUP-->
   <p>The <dfn id=concept-option-selectedness title=concept-option-selectedness>selectedness</dfn> of an <code><a href=#the-option-element>option</a></code>
   element is a boolean state, initially false. Except where otherwise specified, when the element is
   created, its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set to true if
   the element has a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute. Whenever an
   <code><a href=#the-option-element>option</a></code> element's <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute is
-  added, its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set to true.</p>
+  added, if its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> is true, its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set to true.
+  Whenever an
+  <code><a href=#the-option-element>option</a></code> element's <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute is
+  <em>removed</em>, if its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> is true, its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set to false.</p>
 
   <p class=note>The <code title=dom-option><a href=#dom-option>Option()</a></code> constructor, when called with three
   or fewer arguments, overrides the initial state of the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> state to always be false even if the third
@@ -44510,9 +44523,10 @@
   return the element's <a href=#concept-option-value title=concept-option-value>value</a>. On setting, the element's
   <code title=attr-option-value><a href=#attr-option-value>value</a></code> content attribute must be set to the new value.</p>
 
+<!--CLEANUP-->
   <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, and then cause the
+  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, set its <a href=#concept-option-dirtiness title=concept-option-dirtiness>dirtiness</a> to true, 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

Modified: source
===================================================================
--- source	2013-11-19 00:23:06 UTC (rev 8296)
+++ source	2013-11-19 20:20:46 UTC (rev 8297)
@@ -47943,6 +47943,7 @@
 
   <div class="impl">
 
+<!--CLEANUP-->
   <p>If the <code data-x="attr-select-multiple">multiple</code> attribute is absent, and the element
   is not <span data-x="concept-fe-disabled">disabled</span>, then the user agent should allow the
   user to pick an <code>option</code> element in its <span data-x="concept-select-option-list">list
@@ -47953,7 +47954,7 @@
   relevant user interaction event <!-- interaction event spec point --> is queued (e.g. before the
   <code data-x="event-click">click</code> event), the user agent must set the <span
   data-x="concept-option-selectedness">selectedness</span> of the picked <code>option</code> element
-  to true and then <span>queue a task</span> to <span>fire a simple event</span> that bubbles named
+  to true, set its <span data-x="concept-option-dirtiness">dirtiness</span> to true, and then <span>queue a task</span> to <span>fire a simple event</span> that bubbles named
   <code data-x="event-change">change</code> at the <code>select</code> element, using the <span>user
   interaction task source</span> as the task source.</p>
 
@@ -47967,6 +47968,7 @@
   data-x="concept-option-selectedness">selectedness</span> of all the other <code>option</code>
   elements in its <span data-x="concept-select-option-list">list of options</span> to false.</p>
 
+<!--CLEANUP-->
   <p>If the <code data-x="attr-select-multiple">multiple</code> attribute is absent and the element's
   <span data-x="concept-select-size">display size</span> is greater than 1, then the user agent
   should also allow the user to request that the <code>option</code> whose <span
@@ -47974,7 +47976,7 @@
   request being conveyed to the user agent, and before the relevant user interaction event <!--
   interaction event spec point --> is queued (e.g. before the <code data-x="event-click">click</code>
   event), the user agent must set the <span data-x="concept-option-selectedness">selectedness</span>
-  of that <code>option</code> element to false and then <span>queue a task</span> to <span>fire a
+  of that <code>option</code> element to false, set its <span data-x="concept-option-dirtiness">dirtiness</span> to true, and then <span>queue a task</span> to <span>fire a
   simple event</span> that bubbles named <code data-x="event-change">change</code> at the
   <code>select</code> element, using the <span>user interaction task source</span> as the task
   source.</p>
@@ -47993,26 +47995,28 @@
   options</span> in <span>tree order</span> that is not <span
   data-x="concept-option-disabled">disabled</span>, if any, to true.</p>
 
+<!--CLEANUP-->
   <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
   data-x="concept-option-selectedness">selectedness</span> of the <code>option</code> elements in its
   <span data-x="concept-select-option-list">list of options</span> that are themselves not <span
-  data-x="concept-option-disabled">disabled</span> (either through a click, or through a <span
-  data-x="option-command">menu command</span>, or any other mechanism). Upon the <span
-  data-x="concept-option-selectedness">selectedness</span> of one or more <code>option</code>
-  elements being changed by the user, and before the relevant user interaction event <!--
+  data-x="concept-option-disabled">disabled</span>. Upon such an element being <span data-x="concept-select-toggle">toggled</span> (either through a click, or through a <span
+  data-x="option-command">menu command</span>, or any other mechanism), and before the relevant user interaction event <!--
   interaction event spec point --> is queued (e.g. before a related <code
-  data-x="event-click">click</code> event), the user agent must <span>queue a task</span> to
+  data-x="event-click">click</code> event), the <span
+  data-x="concept-option-selectedness">selectedness</span> of the <code>option</code>
+  element must be changed (from true to false or false to true), the <span data-x="concept-option-dirtiness">dirtiness</span> of the element must be set to true, and the user agent must <span>queue a task</span> to
   <span>fire a simple event</span> that bubbles named <code data-x="event-change">change</code> at
   the <code>select</code> element, using the <span>user interaction task source</span> as the task
   source.</p>
 
+<!--CLEANUP-->
   <p>The <span data-x="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
   data-x="concept-select-option-list">list of options</span>, set their <span
   data-x="concept-option-selectedness">selectedness</span> to true if the <code>option</code> element
-  has a <code data-x="attr-option-selected">selected</code> attribute, and false otherwise, and then
+  has a <code data-x="attr-option-selected">selected</code> attribute, and false otherwise, set their <span data-x="concept-option-dirtiness">dirtiness</span> to false, and then
   have the <code>option</code> elements <span>ask for a reset</span>.</p>
 
   </div>
@@ -48195,12 +48199,13 @@
   data-x="concept-option-selectedness">selectedness</span> set to true, if any. If there isn't one,
   then it must return &#x2212;1.</p>
 
+<!--CLEANUP-->
   <p>On setting, the <code data-x="dom-select-selectedIndex">selectedIndex</code> attribute must set
   the <span data-x="concept-option-selectedness">selectedness</span> of all the <code>option</code>
   elements in the <span data-x="concept-select-option-list">list of options</span> to false, and then
   the <code>option</code> element in the <span data-x="concept-select-option-list">list of
   options</span> whose <span data-x="concept-option-index">index</span> is the given new value, if
-  any, must have its <span data-x="concept-option-selectedness">selectedness</span> set to true.</p>
+  any, must have its <span data-x="concept-option-selectedness">selectedness</span> set to true and its <span data-x="concept-option-dirtiness">dirtiness</span> set to true.</p>
 
   <p class="note">This can result in no element having a <span
   data-x="concept-option-selectedness">selectedness</span> set to true even in the case of the
@@ -48213,13 +48218,14 @@
   order</span> that has its <span data-x="concept-option-selectedness">selectedness</span> set to
   true, if any. If there isn't one, then it must return the empty string.</p>
 
+<!--CLEANUP-->
   <p>On setting, the <code data-x="dom-select-value">value</code> attribute must set the <span
   data-x="concept-option-selectedness">selectedness</span> of all the <code>option</code> elements in
   the <span data-x="concept-select-option-list">list of options</span> to false, and then the first
   <code>option</code> element in the <span data-x="concept-select-option-list">list of
   options</span>, in <span>tree order</span>, whose <span data-x="concept-option-value">value</span>
   is equal to the given new value, if any, must have its <span
-  data-x="concept-option-selectedness">selectedness</span> set to true.</p>
+  data-x="concept-option-selectedness">selectedness</span> set to true and its <span data-x="concept-option-dirtiness">dirtiness</span> set to true.</p>
 
   <p class="note">This can result in no element having a <span
   data-x="concept-option-selectedness">selectedness</span> set to true even in the case of the
@@ -48592,12 +48598,20 @@
 
   <div class="impl">
 
+  <p>The <dfn data-x="concept-option-dirtiness">dirtiness</dfn> of an <code>option</code> element is
+  a boolean state, initially false. It controls whether adding or removing the <code
+  data-x="attr-option-selected">selected</code> content attribute has any effect.</p>
+
+<!--CLEANUP-->
   <p>The <dfn data-x="concept-option-selectedness">selectedness</dfn> of an <code>option</code>
   element is a boolean state, initially false. Except where otherwise specified, when the element is
   created, its <span data-x="concept-option-selectedness">selectedness</span> must be set to true if
   the element has a <code data-x="attr-option-selected">selected</code> attribute. Whenever an
   <code>option</code> element's <code data-x="attr-option-selected">selected</code> attribute is
-  added, its <span data-x="concept-option-selectedness">selectedness</span> must be set to true.</p>
+  added, if its <span data-x="concept-option-dirtiness">dirtiness</span> is true, its <span data-x="concept-option-selectedness">selectedness</span> must be set to true.
+  Whenever an
+  <code>option</code> element's <code data-x="attr-option-selected">selected</code> attribute is
+  <em>removed</em>, if its <span data-x="concept-option-dirtiness">dirtiness</span> is true, its <span data-x="concept-option-selectedness">selectedness</span> must be set to false.</p>
 
   <p class="note">The <code data-x="dom-option">Option()</code> constructor, when called with three
   or fewer arguments, overrides the initial state of the <span
@@ -48699,10 +48713,11 @@
   return the element's <span data-x="concept-option-value">value</span>. On setting, the element's
   <code data-x="attr-option-value">value</code> content attribute must be set to the new value.</p>
 
+<!--CLEANUP-->
   <p>The <dfn data-x="dom-option-selected"><code>selected</code></dfn> IDL attribute, on getting,
   must return true if the element's <span data-x="concept-option-selectedness">selectedness</span> is
   true, and false otherwise. On setting, it must set the element's <span
-  data-x="concept-option-selectedness">selectedness</span> to the new value, and then cause the
+  data-x="concept-option-selectedness">selectedness</span> to the new value, set its <span data-x="concept-option-dirtiness">dirtiness</span> to true, and then cause the
   element to <span>ask for a reset</span>.</p>
 
   <p>The <dfn data-x="dom-option-index"><code>index</code></dfn> IDL attribute must return the




More information about the Commit-Watchers mailing list