Skip to content
Permalink
Browse files

[ct] (0) WF2: <label> element summary; make <label> and <fieldset> as…

…sociate with the form element pointer.

git-svn-id: http://svn.whatwg.org/webapps@2146 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Sep 3, 2008
1 parent fe5d397 commit 62b5a0e8a5401979e39444abd25b69266a198bf8
Showing with 170 additions and 44 deletions.
  1. +107 −40 index
  2. +63 −4 source
147 index

<p class=big-issue>...

<h4 id=the-label><span class=secno>4.9.5 </span>The <code>label</code>
element</h4>
<h4 id=the-label><span class=secno>4.9.5 </span>The <dfn
id=label><code>label</code></dfn> element</h4>

<dl class=element>
<dt>Categories

<dd><a href="#phrasing0">Phrasing content</a>.

<dd><a href="#interactive1">Interactive content</a>.

<dt>Contexts in which this element may be used:

<dd>Where <a href="#phrasing0">phrasing content</a> is expected.

<dt>Content model:

<dd><a href="#phrasing0">Phrasing content</a>.

<dt>Element-specific attributes:

<dd><code title=attr-label-form>form</code>

<dd><code title=attr-label-for>for</code>

<dt>DOM interface:

<dd>
<pre
class=idl>interface <dfn id=htmllabelelement>HTMLLabelElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
readonly attribute HTMLFormElement <span title=dom-label-form>form</span>;
attribute DOMString <span title=dom-label-htmlFor>htmlFor</span>;
readonly attribute <a href="#htmlelement">HTMLElement</a> <span title=dom-label-control>control</span>;
};</pre>
</dl>

<p class=big-issue>...

<h4 id=the-select><span class=secno>4.9.6 </span>The <code>select</code>
element</h4>

<dd><code title=attr-command-type><a href="#type13">type</a></code>

<dd><code title=attr-command-label><a href="#label">label</a></code>
<dd><code title=attr-command-label><a href="#label0">label</a></code>

<dd><code title=attr-command-icon><a href="#icon">icon</a></code>

<pre
class=idl>interface <dfn id=htmlcommandelement>HTMLCommandElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#type14" title=dom-command-type>type</a>;
attribute DOMString <a href="#label0" title=dom-command-label>label</a>;
attribute DOMString <a href="#label1" title=dom-command-label>label</a>;
attribute DOMString <a href="#icon0" title=dom-command-icon>icon</a>;
attribute boolean <a href="#disabled5" title=dom-command-disabled>disabled</a>;
attribute boolean <a href="#checked1" title=dom-command-checked>checked</a>;
may also be omitted if the element is to represent the first of these
types, a simple command.

<p>The <dfn id=label title=attr-command-label><code>label</code></dfn>
<p>The <dfn id=label0 title=attr-command-label><code>label</code></dfn>
attribute gives the name of the command, as shown to the user.

<p>The <dfn id=title6 title=attr-command-title><code>title</code></dfn>
</div>

<p>The <dfn id=type14 title=dom-command-type><code>type</code></dfn>, <dfn
id=label0 title=dom-command-label><code>label</code></dfn>, <dfn id=icon0
id=label1 title=dom-command-label><code>label</code></dfn>, <dfn id=icon0
title=dom-command-icon><code>icon</code></dfn>, <dfn id=disabled5
title=dom-command-disabled><code>disabled</code></dfn>, <dfn id=checked1
title=dom-command-checked><code>checked</code></dfn>, <dfn id=radiogroup0

<dd><code title=attr-menu-type><a href="#type17">type</a></code>

<dd><code title=attr-menu-label><a href="#label1">label</a></code>
<dd><code title=attr-menu-label><a href="#label2">label</a></code>

<dt>DOM interface:

<dd>
<pre
class=idl>interface <dfn id=htmlmenuelement>HTMLMenuElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#type18" title=dom-menu-type>type</a>;
attribute DOMString <a href="#label2" title=dom-menu-label>label</a>;
attribute DOMString <a href="#label3" title=dom-menu-label>label</a>;
};</pre>
</dl>

href="#li">li</a></code> element children, <a href="#flow-content0">flow
content</a> describing available commands.

<p>The <dfn id=label1 title=attr-menu-label><code>label</code></dfn>
<p>The <dfn id=label2 title=attr-menu-label><code>label</code></dfn>
attribute gives the label of the menu. It is used by user agents to
display nested menus in the UI. For example, a context menu containing
another menu would use the nested menu's <code title=attr-menu-label><a
href="#label1">label</a></code> attribute for the submenu's menu label.
href="#label2">label</a></code> attribute for the submenu's menu label.

<p>The <dfn id=type18 title=dom-menu-type><code>type</code></dfn> and <dfn
id=label2 title=dom-menu-label><code>label</code></dfn> DOM attributes
id=label3 title=dom-menu-label><code>label</code></dfn> DOM attributes
must <a href="#reflect">reflect</a> the content attributes of the same
name.

element.

<dt>A <code><a href="#menu">menu</a></code> element with no <code
title=attr-menu-label><a href="#label1">label</a></code> attribute
title=attr-menu-label><a href="#label2">label</a></code> attribute

<dt>A <code>select</code> element

then append another separator.

<dt>A <code><a href="#menu">menu</a></code> element with a <code
title=attr-menu-label><a href="#label1">label</a></code> attribute
title=attr-menu-label><a href="#label2">label</a></code> attribute

<dt>An <code>optgroup</code> element

<dd><a href="#ignored">Ignore</a> the node.
</dl>

<p class=issue>We should support <code>label</code> in the algorithm above
-- just iterate through the contents like with <code><a
href="#li">li</a></code>, to support <code><a
href="#input0">input</a></code> elements in <code>label</code> elements.
Also, <code>optgroup</code> elements without labels should be ignored
(maybe? or at least should say they have no label so that they are dropped
below), and <code>select</code> elements inside <code>label</code>
elements may need special processing.
<p class=issue>We should support <code><a href="#label">label</a></code> in
the algorithm above -- just iterate through the contents like with
<code><a href="#li">li</a></code>, to support <code><a
href="#input0">input</a></code> elements in <code><a
href="#label">label</a></code> elements. Also, <code>optgroup</code>
elements without labels should be ignored (maybe? or at least should say
they have no label so that they are dropped below), and
<code>select</code> elements inside <code><a
href="#label">label</a></code> elements may need special processing.

<p>Once all the nodes have been processed as described above, the user
agent must the post-process the menu as follows:
or from script. If a command has no ID, it is an <dfn
id=anonymous>anonymous command</dfn>.

<dt><dfn id=label3 title=command-facet-Label>Label</dfn>
<dt><dfn id=label4 title=command-facet-Label>Label</dfn>

<dd>The name of the command as seen by the user.

-->
readonly attribute DOMString <a href="#commandtype" title=dom-command-ro-commandType>commandType</a>;
readonly attribute DOMString <a href="#id2" title=dom-command-ro-id>id</a>;
readonly attribute DOMString <a href="#label4" title=dom-command-ro-label>label</a>;
readonly attribute DOMString <a href="#label5" title=dom-command-ro-label>label</a>;
readonly attribute DOMString <a href="#title7" title=dom-command-ro-title>title</a>;
readonly attribute DOMString <a href="#icon2" title=dom-command-ro-icon>icon</a>;
readonly attribute boolean <a href="#hidden0" title=dom-command-ro-hidden>hidden</a>;
by the <code title=dom-id><a href="#id0">id</a></code> DOM attribute on
the <code><a href="#htmlelement">HTMLElement</a></code> interface.

<p>The <dfn id=label4 title=dom-command-ro-label><code>label</code></dfn>
attribute must return the command's <a href="#label3"
<p>The <dfn id=label5 title=dom-command-ro-label><code>label</code></dfn>
attribute must return the command's <a href="#label4"
title=command-facet-Label>Label</a>, or null if the element does not
define a command or does not specify a <a href="#label3"
define a command or does not specify a <a href="#label4"
title=command-facet-Label>Label</a>. This attribute will be shadowed by
the <code title="">label</code> DOM attribute on <code>option</code> and
<code><a href="#command0">command</a></code> elements.
the element, if the attribute is present and not empty. Otherwise the
command is an <a href="#anonymous">anonymous command</a>.

<p>The <a href="#label3" title=command-facet-Label>Label</a> of the command
<p>The <a href="#label4" title=command-facet-Label>Label</a> of the command
is the string given by the element's <code><a
href="#textcontent">textContent</a></code> DOM attribute.

href="#command1" title=concept-command>defines a command</a>.

<p>The <a href="#type19" title=command-facet-Type>Type</a>, <a href="#id1"
title=command-facet-ID>ID</a>, <a href="#label3"
title=command-facet-ID>ID</a>, <a href="#label4"
title=command-facet-Label>Label</a>, <a href="#hint"
title=command-facet-Hint>Hint</a>, <a href="#icon1"
title=command-facet-Icon>Icon</a>, <a href="#hidden"
the element, if the attribute is present and not empty. Otherwise the
command is an <a href="#anonymous">anonymous command</a>.

<p>The <a href="#label3" title=command-facet-Label>Label</a> of the command
<p>The <a href="#label4" title=command-facet-Label>Label</a> of the command
depends on the Type of the command:

<p>If the <a href="#type19" title=command-facet-Type>Type</a> is "command",
the button itself if the attribute is absent.

<p>Otherwise, the <a href="#type19" title=command-facet-Type>Type</a> is
"radio" or "checkbox". If the element has a <code>label</code> element
associated with it, the <code><a
"radio" or "checkbox". If the element has a <code><a
href="#label">label</a></code> element associated with it, the <code><a
href="#textcontent">textContent</a></code> of the first such element is
the <a href="#label3" title=command-facet-Label>Label</a> (in DOM terms,
the <a href="#label4" title=command-facet-Label>Label</a> (in DOM terms,
this the string given by <code><var
title="">element</var>.labels[0].textContent</code>). Otherwise, the value
of the <code>value</code> attribute, if present, is the <a href="#label3"
title=command-facet-Label>Label</a>. Otherwise, the <a href="#label3"
of the <code>value</code> attribute, if present, is the <a href="#label4"
title=command-facet-Label>Label</a>. Otherwise, the <a href="#label4"
title=command-facet-Label>Label</a> is the empty string.

<p>The <a href="#hint" title=command-facet-Hint>Hint</a> of the command is
the element, if the attribute is present and not empty. Otherwise the
command is an <a href="#anonymous">anonymous command</a>.

<p>The <a href="#label3" title=command-facet-Label>Label</a> of the command
<p>The <a href="#label4" title=command-facet-Label>Label</a> of the command
is the value of the <code>option</code> element's <code
title=attr-option-label>label</code> attribute, if there is one, or the
value of the <code>option</code> element's <code><a
the element, if the attribute is present and not empty. Otherwise the
command is an <a href="#anonymous">anonymous command</a>.

<p>The <a href="#label3" title=command-facet-Label>Label</a> of the command
<p>The <a href="#label4" title=command-facet-Label>Label</a> of the command
is the value of the element's <code title=attr-command-label><a
href="#label">label</a></code> attribute, if there is one, or the empty
href="#label0">label</a></code> attribute, if there is one, or the empty
string if it doesn't.

<p>The <a href="#hint" title=command-facet-Hint>Hint</a> of the command is
the element, if the attribute is present and not empty. Otherwise the
command is an <a href="#anonymous">anonymous command</a>.

<p>The <a href="#label3" title=command-facet-Label>Label</a> of the command
<p>The <a href="#label4" title=command-facet-Label>Label</a> of the command
is the string given by the element's <code><a
href="#textcontent">textContent</a></code> DOM attribute, if that is not
the empty string, or a user-agent-defined string appropriate for the

<dt>A start tag whose tag name is one of: "address", "article", "aside",
"blockquote", "center", "datagrid", "details", "dialog", "dir", "div",
"dl", "fieldset", "figure", "footer", "h1", "h2", "h3", "h4", "h5", "h6",
"header", "menu", "nav", "ol", "p", "section", "ul"
"dl", "figure", "footer", "h1", "h2", "h3", "h4", "h5", "h6", "header",
"menu", "nav", "ol", "p", "section", "ul"

<dd> <!-- As of May 2008 this doesn't match any browser exactly, but is
as close to what IE does as I can get without doing the non-tree
the <code title=form><a href="#form">form</a></code> element pointer to
point to the element created.</p>
</dd>
<!-- as normal, but associated with the form element pointer -->

<dt>A start tag whose tag name is "fieldset"

<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
title="has an element in scope">has a <code>p</code> element in
scope</a>, then act as if an end tag with the tag name "p" had been
seen.</p>

<p><a href="#insert0">Insert an HTML element</a> for the token.</p>

<p>If the <a href="#form-element"><code title="">form</code> element
pointer</a> is not null, then <span>associate</span><!--XXX xref! -->
the newly created <code><a href="#fieldset">fieldset</a></code> element
with the <code><a href="#form">form</a></code> element pointed to by the
<a href="#form-element"><code title="">form</code> element pointer</a>.</p>
</dd>
<!-- as normal, but imply </li> when there's another <li> open in weird cases -->

<dt>A start tag whose tag name is "li"
the <code><a href="#form">form</a></code> element pointed to by the <a
href="#form-element"><code title="">form</code> element pointer</a>.</p>

<dt>A start tag whose tag name is "input"

<dd>
<p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
if any.</p>

<p><a href="#insert0">Insert an HTML element</a> for the token.</p>

<p>If the <a href="#form-element"><code title="">form</code> element
pointer</a> is not null, then <span>associate</span><!--XXX xref! -->
the newly created <code><a href="#label">label</a></code> element with
the <code><a href="#form">form</a></code> element pointed to by the <a
href="#form-element"><code title="">form</code> element pointer</a>.</p>

<dt id=isindex>A start tag whose tag name is "isindex"

<dd>

0 comments on commit 62b5a0e

Please sign in to comment.
You can’t perform that action at this time.