[html5] r2299 - [] (0) WF2: new Option() constructors.

whatwg at whatwg.org whatwg at whatwg.org
Tue Oct 7 17:29:16 PDT 2008


Author: ianh
Date: 2008-10-07 17:29:15 -0700 (Tue, 07 Oct 2008)
New Revision: 2299

Modified:
   index
   source
Log:
[] (0) WF2: new Option() constructors.

Modified: index
===================================================================
--- index	2008-10-08 00:08:12 UTC (rev 2298)
+++ index	2008-10-08 00:29:15 UTC (rev 2299)
@@ -14171,9 +14171,9 @@
   methods from DOM Core such as <code title="">createElement()</code>): <dfn id=dom-image title=dom-image><code>Image()</code></dfn>, <dfn id=dom-image-w title=dom-image-w><code>Image(<var title="">width</var>)</code></dfn>, and <dfn id=dom-image-wh title=dom-image-wh><code>Image(<var title="">width</var>, <var title="">height</var>)</code></dfn>. When invoked as constructors,
   these must return a new <code><a href=#htmlimageelement>HTMLImageElement</a></code> object (a new
   <code><a href=#the-img-element>img</a></code> element). If the <var title="">width</var> argument
-  is present, the new object's <code title=attr-img-width>width</code> content attribute must be set to
+  is present, the new object's <code title=attr-dim-width><a href=#attr-dim-width>width</a></code> content attribute must be set to
   <var title="">width</var>. If the <var title="">height</var>
-  argument is also present, the new object's <code title=attr-img-height>height</code> content attribute must be set
+  argument is also present, the new object's <code title=attr-dim-height><a href=#attr-dim-height>height</a></code> content attribute must be set
   to <var title="">height</var>.</p>
 
 
@@ -26662,8 +26662,9 @@
    <dt>DOM interface:</dt>
    <dd>
 <pre class=idl>[<a href=#dom-option title=dom-option>Constructor</a>(),
- <a href=#dom-option-n title=dom-option-n>Constructor</a>(in DOMString name),
- <a href=#dom-option-nv title=dom-option-nv>Constructor</a>(in DOMString name, in DOMString value)]
+ <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)]
 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> <span title=dom-option-form>form</span>;
@@ -26681,9 +26682,8 @@
   <code><a href=#the-datalist-element>datalist</a></code> element.</p>
 
   <p>The <dfn id=attr-option-disabled title=attr-option-disabled><code>disabled</code></dfn>
-  attribute is a <a href=#boolean-attribute>boolean attribute</a>.</p>
-
-  <p>An <code><a href=#the-option-element>option</a></code> element is <dfn id=concept-option-disabled title=concept-option-disabled>disabled</dfn> if its <code title=attr-option-disabled><a href=#attr-option-disabled>disabled</a></code> is present or if it is
+  attribute is a <a href=#boolean-attribute>boolean attribute</a>. An
+  <code><a href=#the-option-element>option</a></code> element is <dfn id=concept-option-disabled title=concept-option-disabled>disabled</dfn> if its <code title=attr-option-disabled><a href=#attr-option-disabled>disabled</a></code> is present or if it is
   a child of an <code><a href=#the-optgroup-element>optgroup</a></code> element whose <code title=attr-optgroup-disabled><a href=#attr-optgroup-disabled>disabled</a></code> attribute is
   present.</p>
 
@@ -26729,19 +26729,24 @@
   false otherwise.</p>
 
   <p>The <dfn id=dom-option-index title=dom-option-index><code>index</code></dfn> DOM
-  attribute must return the lement's <a href=#concept-option-index title=concept-option-index>index</a>.</p>
+  attribute must return the element's <a href=#concept-option-index title=concept-option-index>index</a>.</p>
 
   <p>The <dfn id=dom-option-text title=dom-option-text><code>text</code></dfn> DOM
   attribute must return the same value as the <code><a href=#textcontent>textContent</a></code>
   DOM attribute on the element.</p>
 
-  <p class=XXX>
-   <dfn id=dom-option title=dom-option><code>Option()</code></dfn>
-   <dfn id=dom-option-n title=dom-option-n><code>Option(<var title="">name</var>)</code></dfn>
-   <dfn id=dom-option-nv title=dom-option-nv><code>Option(<var title="">name</var>, <var title="">value</var>)</code></dfn>
-   ... must return a new <code><a href=#htmloptionelement>HTMLOptionElement</a></code> object (a new
-   <code><a href=#the-option-element>option</a></code> element). ... argument processing ...
-  </p>
+  <p>Four 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>
 
 
   <h4 id=the-textarea-element><span class=secno>4.10.10 </span>The <dfn><code>textarea</code></dfn> element</h4>

Modified: source
===================================================================
--- source	2008-10-08 00:08:12 UTC (rev 2298)
+++ source	2008-10-08 00:29:15 UTC (rev 2299)
@@ -15026,10 +15026,10 @@
   these must return a new <code>HTMLImageElement</code> object (a new
   <code>img</code> element). If the <var title="">width</var> argument
   is present, the new object's <code
-  title="attr-img-width">width</code> content attribute must be set to
+  title="attr-dim-width">width</code> content attribute must be set to
   <var title="">width</var>. If the <var title="">height</var>
   argument is also present, the new object's <code
-  title="attr-img-height">height</code> content attribute must be set
+  title="attr-dim-height">height</code> content attribute must be set
   to <var title="">height</var>.</p>
 
 
@@ -29876,8 +29876,9 @@
    <dt>DOM interface:</dt>
    <dd>
 <pre class="idl">[<span title="dom-option">Constructor</span>(),
- <span title="dom-option-n">Constructor</span>(in DOMString name),
- <span title="dom-option-nv">Constructor</span>(in DOMString name, in DOMString value)]
+ <span title="dom-option-t">Constructor</span>(in DOMString text),
+ <span title="dom-option-tv">Constructor</span>(in DOMString text, in DOMString value),
+ <span title="dom-option-tvd">Constructor</span>(in DOMString text, in DOMString value, in boolean defaultSelected)]
 interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
            attribute boolean <span title="dom-option-disabled">disabled</span>;
   readonly attribute <span>HTMLFormElement</span> <span title="dom-option-form">form</span>;
@@ -29897,9 +29898,8 @@
   <code>datalist</code> element.</p>
 
   <p>The <dfn title="attr-option-disabled"><code>disabled</code></dfn>
-  attribute is a <span>boolean attribute</span>.</p>
-
-  <p>An <code>option</code> element is <dfn
+  attribute is a <span>boolean attribute</span>. An
+  <code>option</code> element is <dfn
   title="concept-option-disabled">disabled</dfn> if its <code
   title="attr-option-disabled">disabled</code> is present or if it is
   a child of an <code>optgroup</code> element whose <code
@@ -29964,20 +29964,36 @@
   false otherwise.</p>
 
   <p>The <dfn title="dom-option-index"><code>index</code></dfn> DOM
-  attribute must return the lement's <span
+  attribute must return the element's <span
   title="concept-option-index">index</span>.</p>
 
   <p>The <dfn title="dom-option-text"><code>text</code></dfn> DOM
   attribute must return the same value as the <code>textContent</code>
   DOM attribute on the element.</p>
 
-  <p class="XXX">
-   <dfn title="dom-option"><code>Option()</code></dfn>
-   <dfn title="dom-option-n"><code>Option(<var title="">name</var>)</code></dfn>
-   <dfn title="dom-option-nv"><code>Option(<var title="">name</var>, <var title="">value</var>)</code></dfn>
-   ... must return a new <code>HTMLOptionElement</code> object (a new
-   <code>option</code> element). ... argument processing ...
-  </p>
+  <p>Four constructors are provided for creating
+  <code>HTMLOptionElement</code> objects (in addition to the factory
+  methods from DOM Core such as <code
+  title="">createElement()</code>): <dfn
+  title="dom-option"><code>Option()</code></dfn>, <dfn
+  title="dom-option-t"><code>Option(<var
+  title="">text</var>)</code></dfn>, <dfn
+  title="dom-option-tv"><code>Option(<var title="">text</var>, <var
+  title="">value</var>)</code></dfn>, and <dfn
+  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>HTMLOptionElement</code>
+  object (a new <code>option</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">value</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">selected</code> attribute set with no
+  value.</p>
 
 
   <h4>The <dfn><code>textarea</code></dfn> element</h4>




More information about the Commit-Watchers mailing list