[giow] (2) Define four-argument form of new Option(), and clarify tha…
…t selectedness is not set to true even if the default state is true.
git-svn-id: http://svn.whatwg.org/webapps@2371 340c8d12-0b0e-0410-8428-c7bf67bfef74
<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)]
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
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>
<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
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>
<p>Four constructors are provided for creating
<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.</p>
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