html5/spec Overview.html,1.1542,1.1543

Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv10260

Modified Files:
	Overview.html 
Log Message:
Define four-argument form of new Option(), and clarify that selectedness is not set to true even if the default state is true. (whatwg r2371)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1542
retrieving revision 1.1543
diff -u -d -r1.1542 -r1.1543
--- Overview.html	28 Oct 2008 09:45:20 -0000	1.1542
+++ Overview.html	28 Oct 2008 09:52:31 -0000	1.1543
@@ -21694,7 +21694,8 @@
 <pre class=idl>[<a href=#dom-option title=dom-option>Constructor</a>(),
  <a href=#dom-option-t title=dom-option-t>Constructor</a>(in DOMString text),
  <a href=#dom-option-tv title=dom-option-tv>Constructor</a>(in DOMString text, in DOMString value),
- <a href=#dom-option-tvd title=dom-option-tvd>Constructor</a>(in DOMString text, in DOMString value, in boolean defaultSelected)]
+ <a href=#dom-option-tvd title=dom-option-tvd>Constructor</a>(in DOMString text, in DOMString value, in boolean defaultSelected),
+ <a href=#dom-option-tvds title=dom-option-tvds>Constructor</a>(in DOMString text, in DOMString value, in boolean defaultSelected, in boolean selected)]
 interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
            attribute boolean <a href=#dom-option-disabled title=dom-option-disabled>disabled</a>;
   readonly attribute <a href=#htmlformelement>HTMLFormElement</a> <a href=#dom-option-form title=dom-option-form>form</a>;
@@ -21727,12 +21728,17 @@
   of an <code><a href=#the-option-element>option</a></code> element is a boolean state, initially
   false. If the element is <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, then the element's
   <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> is
-  always false and cannot be set to true. 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
+  always false and cannot be set to true. Unless othewise 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>An <code><a href=#the-option-element>option</a></code> element's <dfn id=concept-option-index title=concept-option-index>index</dfn> is the number of
+  be set to true.<p class=note>The <code title=dom-option-tvd><a href=#dom-option-tvd>Option()</a></code>
+  constructor with two or more 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 argument is true
+  (implying that a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code>
+  attribute is to be set).<p>An <code><a href=#the-option-element>option</a></code> element's <dfn id=concept-option-index title=concept-option-index>index</dfn> is the number of
   <code><a href=#the-option-element>option</a></code> element that are in the same <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> but that
   come before it in <a href=#tree-order>tree order</a>. If the
   <code><a href=#the-option-element>option</a></code> element is not in a <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, then the
@@ -21753,18 +21759,21 @@
   <code><a href=#the-colgroup-element>colgroup</a></code> element has a <code><a href=#the-select-element>select</a></code> element as
   its parent, then the <code title=dom-option-form><a href=#dom-option-form>form</a></code> DOM
   attribute must return the same value as the <code title=dom-select-form>form</code> DOM attribute on that
-  <code><a href=#the-select-element>select</a></code> element. Otherwise, it must return null.<p>Four constructors are provided for creating
+  <code><a href=#the-select-element>select</a></code> element. Otherwise, it must return null.<p>Several constructors are provided for creating
   <code><a href=#htmloptionelement>HTMLOptionElement</a></code> objects (in addition to the factory
-  methods from DOM Core such as <code title="">createElement()</code>): <dfn id=dom-option title=dom-option><code>Option()</code></dfn>, <dfn id=dom-option-t title=dom-option-t><code>Option(<var title="">text</var>)</code></dfn>, <dfn id=dom-option-tv title=dom-option-tv><code>Option(<var title="">text</var>, <var title="">value</var>)</code></dfn>, and <dfn id=dom-option-tvd title=dom-option-tvd><code>Option(<var title="">text</var>, <var title="">value</var>, <var title="">defaultSelected</var>)</code></dfn>. When invoked as
-  constructors, these must return a new <code><a href=#htmloptionelement>HTMLOptionElement</a></code>
-  object (a new <code><a href=#the-option-element>option</a></code> element). If the <var title="">text</var> argument is present, the new object must have a
-  text node with the value of that argument as its data as its only
-  child. If the <var title="">value</var> argument is present, the new
-  object must have a <code title=attr-option-value><a href=#attr-option-value>value</a></code>
-  attribute set with the value of the argument as its value. If the
-  <var title="">defaultSelected</var> argument is present and true,
-  the new object must have a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute set with no
-  value.<h4 id=the-textarea-element><span class=secno>4.10.10 </span>The <dfn><code>textarea</code></dfn> element</h4><dl class=element><dt>Categories</dt>
+  methods from DOM Core such as <code title="">createElement()</code>): <dfn id=dom-option title=dom-option><code>Option()</code></dfn>, <dfn id=dom-option-t title=dom-option-t><code>Option(<var title="">text</var>)</code></dfn>, <dfn id=dom-option-tv title=dom-option-tv><code>Option(<var title="">text</var>, <var title="">value</var>)</code></dfn>, <dfn id=dom-option-tvd title=dom-option-tvd><code>Option(<var title="">text</var>, <var title="">value</var>, <var title="">defaultSelected</var>)</code></dfn>, and <dfn id=dom-option-tvds title=dom-option-tvds><code>Option(<var title="">text</var>, <var title="">value</var>, <var title="">defaultSelected</var>, <var title="">selected</var>)</code></dfn>. When invoked as constructors,
+  these must return a new <code><a href=#htmloptionelement>HTMLOptionElement</a></code> object (a new
+  <code><a href=#the-option-element>option</a></code> element). If the <var title="">text</var>
+  argument is present, the new object must have a text node with the
+  value of that argument as its data as its only child. If the <var title="">value</var> argument is present, the new object must have a
+  <code title=attr-option-value><a href=#attr-option-value>value</a></code> attribute set with the
+  value of the argument as its value. If the <var title="">defaultSelected</var> argument is present and true, the new
+  object must have a <code title=attr-option-selected><a href=#attr-option-selected>selected</a></code> attribute set with no
+  value. If the <var title="">selected</var> argument is present and
+  true, the new object must have its <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to true;
+  otherwise the fouth argument is absent or false, and the <a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> must be set
+  to false, even if the <var title="">defaultSelected</var> argument
+  is present and true.<h4 id=the-textarea-element><span class=secno>4.10.10 </span>The <dfn><code>textarea</code></dfn> element</h4><dl class=element><dt>Categories</dt>
    <dd><a href=#phrasing-content-0>Phrasing content</a>.</dd>
    <dd><a href=#interactive-content-0>Interactive content</a>.</dd>
    <dd><a href=#category-listed title=category-listed>Listed</a>, <a href=#category-label title=category-label>labelable</a>, <a href=#category-submit title=category-submit>submittable</a>, and <a href=#category-reset title=category-reset>resettable</a> <a href=#form-associated-element>form-associated element</a>.</dd>

Received on Tuesday, 28 October 2008 09:52:44 UTC