spec/Overview.html 1.1364 2191 WF2: <label>. (whatwg r2191)

WF2: <label>. (whatwg r2191)

control
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#control
input
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#input0
4.9.4 The input element
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#the-input
HTMLSelectElement
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#htmlselectelement
HTMLLabelElement
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#htmllabelelement
for
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#for
htmlFor
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#htmlfor
button
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#button
labels
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#labels
label
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#label
HTMLButtonElement
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#htmlbuttonelement
labeled control
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#labeled
Listed
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#listed
textarea
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#textarea
HTMLInputElement
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#htmlinputelement
HTMLTextAreaElement
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#htmltextareaelement
select
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#select
Labelable
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1364.html#labelable

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1363&r2=1.1364&f=h
http://html5.org/tools/web-apps-tracker?from=2190&to=2191

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1363
retrieving revision 1.1364
diff -u -d -r1.1363 -r1.1364
--- Overview.html 16 Sep 2008 00:29:52 -0000 1.1363
+++ Overview.html 16 Sep 2008 08:05:19 -0000 1.1364
@@ -26589,6 +26589,11 @@
     title="">form</var>.elements</a></code> and <code
     title=dom-fieldset-elements><a href="#elements4"><var
     title="">fieldset</var>.elements</a></code> APIs.
+
+   <dt><dfn id=labelable title=category-label>Labelable</dfn>
+
+   <dd>Denotes elements that can be associated with <code><a
+    href="#label">label</a></code> elements.
   </dl>
 
   <p>In addition, some <a href="#submittable"
@@ -26865,13 +26870,22 @@
 
    <dt>Content model:
 
-   <dd><a href="#phrasing0">Phrasing content</a>.
+   <dd>If the element has a <code title=attr-label-for><a
+    href="#for">for</a></code> attribute: <a href="#phrasing0">Phrasing
+    content</a>, but with no descendant <a href="#labelable"
+    title=category-label>labelable form-associated elements</a> or <code><a
+    href="#label">label</a></code> elements.
+
+   <dd>Otherwise: <a href="#phrasing0">Phrasing content</a>, but with at most
+    one descendant <a href="#labelable" title=category-label>labelable
+    form-associated element</a>, and with no descendant <code><a
+    href="#label">label</a></code> elements.
 
    <dt>Element-specific attributes:
 
    <dd><code title=attr-fae-form><a href="#form0">form</a></code>
 
-   <dd><code title=attr-label-for>for</code>
+   <dd><code title=attr-label-for><a href="#for">for</a></code>
 
    <dt>DOM interface:
 
@@ -26879,16 +26893,41 @@
     <pre
      class=idl>interface <dfn id=htmllabelelement>HTMLLabelElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
   readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#form1" title=dom-fae-form>form</a>;
-           attribute DOMString <span title=dom-label-htmlFor>htmlFor</span>;
-  readonly attribute <a href="#htmlelement">HTMLElement</a> <span title=dom-label-control>control</span>;
+           attribute DOMString <a href="#htmlfor" title=dom-label-htmlFor>htmlFor</a>;
+  readonly attribute <a href="#htmlelement">HTMLElement</a> <a href="#control" title=dom-label-control>control</a>;
 };</pre>
   </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><a href="#label">label</a></code> represents a caption in a
+   user interface. The caption can be associated with a specific form
+   control, known as the <code><a href="#label">label</a></code> element's
+   <dfn id=labeled>labeled control</dfn>.
+
+  <p>Unless otherwise specified by the following rules, a <code><a
+   href="#label">label</a></code> element has no <a href="#labeled">labeled
+   control</a>.
+
+  <p>The <dfn id=for 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 <a href="#labelable" title=category-label>labelable
+   form-associated element</a> in the same <code>Document</code> as the
+   <code><a href="#label">label</a></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><a
+   href="#for">for</a></code> attribute, and the first such element is a <a
+   href="#labelable" title=category-label>labelable form-associated
+   element</a>, then that element is the <code><a
+   href="#label">label</a></code> element's <a href="#labeled">labeled
+   control</a>.
+
+  <p>If the <code title=attr-label-for><a href="#for">for</a></code>
+   attribute is not specified, but the <code><a
+   href="#label">label</a></code> element has a <span>labelable
+   form-associated element</span> descendant, then the first such descendant
+   in <a href="#tree-order">tree order</a> is the <code><a
+   href="#label">label</a></code> element's <a href="#labeled">labeled
+   control</a>.
 
   <p>The <code title=attr-fae-form><a href="#form0">form</a></code> attribute
    is used to explicitly associate the <code><a
@@ -26896,6 +26935,28 @@
    owner</a>. The <code title=attr-fe-name><a href="#name11">name</a></code>
    attribute represents the element's name.
 
+  <p>The <dfn id=htmlfor title=dom-label-htmlFor><code>htmlFor</code></dfn>
+   DOM attribute must <a href="#reflect">reflect</a> the <code
+   title=attr-label-for><a href="#for">for</a></code> content attribute.
+
+  <p>The <dfn id=control title=dom-label-control><code>control</code></dfn>
+   DOM attribute must return the <code><a href="#label">label</a></code>
+   element's <a href="#labeled">labeled control</a>, if any, or null if there
+   isn't one.
+
+  <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><a
+   href="#label">label</a></code> elements, in <a href="#tree-order">tree
+   order</a>, whose <a href="#labeled">labeled control</a> is the element in
+   question. The <dfn id=labels
+   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.
+
   <h4 id=the-input><span class=secno>4.9.4 </span>The <dfn
    id=input0><code>input</code></dfn> element</h4>
 
@@ -26907,6 +26968,7 @@
    <dd><a href="#interactive1">Interactive content</a>.
 
    <dd><a href="#listed" title=category-listed>Listed</a>, <a
+    href="#labelable" title=category-label>labelable</a>, <a
     href="#submittable" title=category-submit>submittable</a>, and <a
     href="#resettable" title=category-reset>resettable</a> <a
     href="#form-associated">form-associated element</a>.
@@ -27007,7 +27069,7 @@
            attribute float <span title=dom-input-valueAsNumber>valueAsNumber</span>;
   readonly attribute <a href="#htmloptionelement">HTMLOptionElement</a> <span title=dom-input-selectedOption>selectedOption</span>;
 
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <span title=dom-input-labels>labels</span>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#labels" title=dom-lfe-labels>labels</a>;
 
   void <span title=dom-input-stepUp>stepUp</span>(in int n);
   void <span title=dom-input-stepDown>stepDown</span>(in int n);
@@ -27062,7 +27124,8 @@
 
    <dd><a href="#interactive1">Interactive content</a>.
 
-   <dd><a href="#listed" title=category-listed>Listed</a> and <a
+   <dd><a href="#listed" title=category-listed>Listed</a>, <a
+    href="#labelable" title=category-label>labelable</a>, and <a
     href="#submittable" title=category-submit>submittable</a> <a
     href="#form-associated">form-associated element</a>.
 
@@ -27112,7 +27175,7 @@
            attribute DOMString <span title=dom-button-type>type</span>;
            attribute DOMString <span title=dom-button-value>value</span>;
 
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <span title=dom-button-labels>labels</span>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#labels" title=dom-lfe-labels>labels</a>;
 
   readonly attribute boolean <a href="#willvalidate" title=dom-cva-willValidate>willValidate</a>;
   readonly attribute <span>ValidityState</span> <a href="#validity" title=dom-cva-validity>validity</a>;
@@ -27152,6 +27215,7 @@
    <dd><a href="#interactive1">Interactive content</a>.
 
    <dd><a href="#listed" title=category-listed>Listed</a>, <a
+    href="#labelable" title=category-label>labelable</a>, <a
     href="#submittable" title=category-submit>submittable</a>, and <a
     href="#resettable" title=category-reset>resettable</a> <a
     href="#form-associated">form-associated element</a>.
@@ -27201,7 +27265,7 @@
            attribute long <span title=dom-select-selectedIndex>selectedIndex</span>;
            attribute DOMString <span title=dom-select-value>value</span>;
 
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <span title=dom-select-labels>labels</span>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#labels" title=dom-lfe-labels>labels</a>;
 
   void <span title=dom-select-add>add</span>(in <a href="#htmlelement">HTMLElement</a> element, in <a href="#htmlelement">HTMLElement</a> before);
   void <span title=dom-select-remove>remove</span>(in long index);
@@ -27378,6 +27442,7 @@
    <dd><a href="#interactive1">Interactive content</a>.
 
    <dd><a href="#listed" title=category-listed>Listed</a>, <a
+    href="#labelable" title=category-label>labelable</a>, <a
     href="#submittable" title=category-submit>submittable</a>, and <a
     href="#resettable" title=category-reset>resettable</a> <a
     href="#form-associated">form-associated element</a>.
@@ -27441,7 +27506,7 @@
            attribute DOMString <span title=dom-textarea-defaultValue>defaultValue</span>;
            attribute DOMString <span title=dom-textarea-value>value</span>;
 
-  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <span title=dom-textarea-labels>labels</span>;
+  readonly attribute <a href="#htmlcollection0">HTMLCollection</a> <a href="#labels" title=dom-lfe-labels>labels</a>;
 
   readonly attribute boolean <a href="#willvalidate" title=dom-cva-willValidate>willValidate</a>;
   readonly attribute <span>ValidityState</span> <a href="#validity" title=dom-cva-validity>validity</a>;

Received on Tuesday, 16 September 2008 08:09:23 UTC