HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2191WF2: <label>.2008-09-16 08:05
@@ -23933,20 +23933,25 @@ function AddCloud(data, x, y) { ... }</pre>
    <dd>Denotes elements that can be affected when a <code>form</code>
    element is <span title="concept-form-reset">reset</span>.</dd>
 
    <dt><dfn title="category-listed">Listed</dfn></dt>
 
    <dd>Denotes elements that are listed in the <code
    title="dom-form-elements"><var title="">form</var>.elements</code>
    and <code title="dom-fieldset-elements"><var
    title="">fieldset</var>.elements</code> APIs.</dd>
 
+   <dt><dfn title="category-label">Labelable</dfn></dt>
+
+   <dd>Denotes elements that can be associated with <code>label</code>
+   elements.</dd>
+
   </dl>
 
   <p>In addition, some <span
   title="category-submit">submittable</span> can be, depending on
   their attributes, <dfn title="concept-button">buttons</dfn>. The
   prose below defines when an element is a button.</p>
 
 
   <h4>The <dfn><code>form</code></dfn> element</h4>
 
@@ -24165,54 +24170,96 @@ function AddCloud(data, x, y) { ... }</pre>
   <h4>The <dfn><code>label</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
    <dd><span>Form-associated element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
-   <dd><span>Phrasing content</span>.</dd>
+   <dd>If the element has a <code title="attr-label-for">for</code> attribute: <span>Phrasing content</span>, but with no descendant <span title="category-label">labelable form-associated elements</span> or <code>label</code> elements.</dd>
+   <dd>Otherwise: <span>Phrasing content</span>, but with at most one descendant <span title="category-label">labelable form-associated element</span>, and with no descendant <code>label</code> elements.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-fae-form">form</code></dd>
    <dd><code title="attr-label-for">for</code></dd>
    <dt>DOM interface:</dt>
    <dd>
 <pre class="idl">interface <dfn>HTMLLabelElement</dfn> : <span>HTMLElement</span> {
   readonly attribute <span>HTMLFormElement</span> <span title="dom-fae-form">form</span>;
            attribute DOMString <span title="dom-label-htmlFor">htmlFor</span>;
   readonly attribute <span>HTMLElement</span> <span title="dom-label-control">control</span>;
 };</pre>
    </dd> 
   </dl>
 
-  <p class="big-issue">...</p>
-<!--XXX
-what does <label> _mean_? how about an empty one, one which contains
-more than one control, no controls?
--->
+  <p>The <code>label</code> represents a caption in a user
+  interface. The caption can be associated with a specific form
+  control, known as the <code>label</code> element's <dfn>labeled
+  control</dfn>.</p>
+
+  <p>Unless otherwise specified by the following rules, a
+  <code>label</code> element has no <span>labeled control</span>.</p>
+
+  <p>The <dfn title="attr-label-for"><code>for</code></dfn> attribute
+  may be specified to indicate a form control with which the caption
+  is to be associated. If the attribute is specified, the attribute's
+  value must be the ID of a <span title="category-label">labelable
+  form-associated element</span> in the same <code>Document</code> as
+  the <code>label</code> element. If the attribute is specified and
+  there is an element in the <code>Document</code> whose ID is equal
+  to the value of the <code title="attr-label-for">for</code>
+  attribute, and the first such element is a <span
+  title="category-label">labelable form-associated element</span>,
+  then that element is the <code>label</code> element's <span>labeled
+  control</span>.</p>
+
+  <p>If the <code title="attr-label-for">for</code> attribute is not
+  specified, but the <code>label</code> element has a <span>labelable
+  form-associated element</span> descendant, then the first such
+  descendant in <span>tree order</span> is the <code>label</code>
+  element's <span>labeled control</span>.</p>
 
   <p>The <code title="attr-fae-form">form</code> attribute is used to
   explicitly associate the <code>label</code> element with its
   <span>form owner</span>. The <code title="attr-fe-name">name</code>
   attribute represents the element's name.</p>
 
+  <p>The <dfn title="dom-label-htmlFor"><code>htmlFor</code></dfn> DOM
+  attribute must <span>reflect</span> the <code
+  title="attr-label-for">for</code> content attribute.</p>
+
+  <p>The <dfn title="dom-label-control"><code>control</code></dfn> DOM
+  attribute must return the <code>label</code> element's <span>labeled
+  control</span>, if any, or null if there isn't one.</p>
+
+  <hr>
+
+  <p><span title="labelable form-associated element">Labelable
+  form-associated elements</span> have a <code>NodeList</code> object
+  associated with them that represents the list of <code>label</code>
+  elements, in <span>tree order</span>, whose <span>labeled
+  control</span> is the element in question. The <dfn
+  title="dom-lfe-labels"><code>labels</code></dfn> DOM attribute of
+  <span title="labelable form-associated element">labelable
+  form-associated elements</span>, on getting, must return that
+  <code>NodeList</code> object.</p>
+
 
 
   <h4>The <dfn><code>input</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
-   <dd><span title="category-listed">Listed</span>, <span title="category-submit">submittable</span>, and <span title="category-reset">resettable</span> <span>form-associated element</span>.</dd>
+   <dd><span title="category-listed">Listed</span>, <span title="category-label">labelable</span>, <span title="category-submit">submittable</span>, and <span title="category-reset">resettable</span> <span>form-associated element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
    <dd>Empty.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-input-accept">accept</code></dd>
    <dd><code title="attr-fs-action">action</code></dd>
    <dd><code title="attr-input-alt">alt</code></dd>
    <dd><code title="attr-input-autocomplete">autocomplete</code></dd>
    <dd><code title="attr-input-autofocus">autofocus</code></dd>
@@ -24263,21 +24310,21 @@ more than one control, no controls?
            attribute DOMString <span title="dom-input-src">src</span>;
            attribute DOMString <span title="dom-input-step">step</span>;
            attribute DOMString <span title="dom-fs-target">target</span>;
            attribute DOMString <span title="dom-input-type">type</span>;
            attribute DOMString <span title="dom-input-defaultValue">defaultValue</span>;
            attribute DOMString <span title="dom-input-value">value</span>;
            attribute DOMTimeStamp <span title="dom-input-valueAsDate">valueAsDate</span>;
            attribute float <span title="dom-input-valueAsNumber">valueAsNumber</span>;
   readonly attribute <span>HTMLOptionElement</span> <span title="dom-input-selectedOption">selectedOption</span>;
 
-  readonly attribute <span>HTMLCollection</span> <span title="dom-input-labels">labels</span>;
+  readonly attribute <span>HTMLCollection</span> <span title="dom-lfe-labels">labels</span>;
 
   void <span title="dom-input-stepUp">stepUp</span>(in int n);
   void <span title="dom-input-stepDown">stepDown</span>(in int n);
 
   readonly attribute boolean <span title="dom-cva-willValidate">willValidate</span>;
   readonly attribute <span>ValidityState</span> <span title="dom-cva-validity">validity</span>;
   readonly attribute DOMString <span title="dom-cva-validationMessage">validationMessage</span>;
   boolean <span title="dom-cva-checkValidatity">checkValidity</span>();
   void <span title="dom-cva-setCustomValidity">setCustomValidity</span>(in DOMString error);
 };</pre>
@@ -24313,21 +24360,21 @@ rel="" on submit buttons?
   methods, are part of the <span>constraint validation API</span>.</p>
 
 
 
   <h4>The <dfn><code>button</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
-   <dd><span title="category-listed">Listed</span> and <span title="category-submit">submittable</span> <span>form-associated element</span>.</dd>
+   <dd><span title="category-listed">Listed</span>, <span title="category-label">labelable</span>, and <span title="category-submit">submittable</span> <span>form-associated element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
    <dd><span>Phrasing content</span>.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-fs-action">action</code></dd>
    <dd><code title="attr-button-autofocus">autofocus</code></dd>
    <dd><code title="attr-fe-disabled">disabled</code></dd>
    <dd><code title="attr-fs-enctype">enctype</code></dd>
    <dd><code title="attr-fae-form">form</code></dd>
@@ -24343,21 +24390,21 @@ rel="" on submit buttons?
            attribute boolean <span title="dom-button-autofocus">autofocus</span>;
            attribute boolean <span title="dom-fe-disabled">disabled</span>;
            attribute DOMString <span title="dom-fs-enctype">enctype</span>;
   readonly attribute <span>HTMLFormElement</span> <span title="dom-fae-form">form</span>;
            attribute DOMString <span title="dom-fs-method">method</span>;
            attribute DOMString <span title="dom-fe-name">name</span>;
            attribute DOMString <span title="dom-fs-target">target</span>;
            attribute DOMString <span title="dom-button-type">type</span>;
            attribute DOMString <span title="dom-button-value">value</span>;
 
-  readonly attribute <span>HTMLCollection</span> <span title="dom-button-labels">labels</span>;
+  readonly attribute <span>HTMLCollection</span> <span title="dom-lfe-labels">labels</span>;
 
   readonly attribute boolean <span title="dom-cva-willValidate">willValidate</span>;
   readonly attribute <span>ValidityState</span> <span title="dom-cva-validity">validity</span>;
   readonly attribute DOMString <span title="dom-cva-validationMessage">validationMessage</span>;
   boolean <span title="dom-cva-checkValidatity">checkValidity</span>();
   void <span title="dom-cva-setCustomValidity">setCustomValidity</span>(in DOMString error);
 };</pre>
    </dd> 
   </dl>
 
@@ -24378,21 +24425,21 @@ rel="" on submit buttons?
   methods, are part of the <span>constraint validation API</span>.</p>
 
 
 
   <h4>The <dfn><code>select</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
-   <dd><span title="category-listed">Listed</span>, <span title="category-submit">submittable</span>, and <span title="category-reset">resettable</span> <span>form-associated element</span>.</dd>
+   <dd><span title="category-listed">Listed</span>, <span title="category-label">labelable</span>, <span title="category-submit">submittable</span>, and <span title="category-reset">resettable</span> <span>form-associated element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
    <dd>Zero or more <code>option</code> or <code>optgroup</code> elements.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-select-autofocus">autofocus</code></dd>
    <dd><code title="attr-fe-disabled">disabled</code></dd>
    <dd><code title="attr-fae-form">form</code></dd>
    <dd><code title="attr-select-multiple">multiple</code></dd>
    <dd><code title="attr-fe-name">name</code></dd>
@@ -24410,21 +24457,21 @@ rel="" on submit buttons?
   readonly attribute DOMString <span title="dom-select-type">type</span>;
 
   readonly attribute <span>HTMLOptionsCollection</span> <span title="dom-select-options">options</span>;
            attribute unsigned long <span title="dom-select-length">length</span>;
   [IndexGetter] <span>HTMLElement</span> <span title="dom-select-XXX9">XXX9</span>(in unsigned long index);
 
   readonly attribute <span>HTMLOptionsCollection</span> <span title="dom-select-selectedOptions">selectedOptions</span>;
            attribute long <span title="dom-select-selectedIndex">selectedIndex</span>;
            attribute DOMString <span title="dom-select-value">value</span>;
 
-  readonly attribute <span>HTMLCollection</span> <span title="dom-select-labels">labels</span>;
+  readonly attribute <span>HTMLCollection</span> <span title="dom-lfe-labels">labels</span>;
 
   void <span title="dom-select-add">add</span>(in <span>HTMLElement</span> element, in <span>HTMLElement</span> before);
   void <span title="dom-select-remove">remove</span>(in long index);
 
   readonly attribute boolean <span title="dom-cva-willValidate">willValidate</span>;
   readonly attribute <span>ValidityState</span> <span title="dom-cva-validity">validity</span>;
   readonly attribute DOMString <span title="dom-cva-validationMessage">validationMessage</span>;
   boolean <span title="dom-cva-checkValidatity">checkValidity</span>();
   void <span title="dom-cva-setCustomValidity">setCustomValidity</span>(in DOMString error);
 };</pre>
@@ -24545,21 +24592,21 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
    <code>option</code> element). ... argument processing ...
   </p>
 
 
   <h4>The <dfn><code>textarea</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
-   <dd><span title="category-listed">Listed</span>, <span title="category-submit">submittable</span>, and <span title="category-reset">resettable</span> <span>form-associated element</span>.</dd>
+   <dd><span title="category-listed">Listed</span>, <span title="category-label">labelable</span>, <span title="category-submit">submittable</span>, and <span title="category-reset">resettable</span> <span>form-associated element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
    <dd>Text.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-textarea-accept">accept</code></dd>
    <dd><code title="attr-textarea-autofocus">autofocus</code></dd>
    <dd><code title="attr-textarea-cols">cols</code></dd>
    <dd><code title="attr-fe-disabled">disabled</code></dd>
    <dd><code title="attr-fae-form">form</code></dd>
@@ -24585,21 +24632,21 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
            attribute DOMString <span title="dom-textarea-pattern">pattern</span>;
            attribute boolean <span title="dom-textarea-readOnly">readOnly</span>;
            attribute boolean <span title="dom-textarea-required">required</span>;
            attribute unsigned long <span title="dom-textarea-rows">rows</span>;
            attribute DOMString <span title="dom-textarea-wrap">wrap</span>;
 
   readonly attribute DOMString <span title="dom-textarea-type">type</span>;
            attribute DOMString <span title="dom-textarea-defaultValue">defaultValue</span>;
            attribute DOMString <span title="dom-textarea-value">value</span>;
 
-  readonly attribute <span>HTMLCollection</span> <span title="dom-textarea-labels">labels</span>;
+  readonly attribute <span>HTMLCollection</span> <span title="dom-lfe-labels">labels</span>;
 
   readonly attribute boolean <span title="dom-cva-willValidate">willValidate</span>;
   readonly attribute <span>ValidityState</span> <span title="dom-cva-validity">validity</span>;
   readonly attribute DOMString <span title="dom-cva-validationMessage">validationMessage</span>;
   boolean <span title="dom-cva-checkValidatity">checkValidity</span>();
   void <span title="dom-cva-setCustomValidity">setCustomValidity</span>(in DOMString error);
 };</pre>
    </dd> 
   </dl>
 

|