[html5] r2415 - [c] (0) Define better the restrictions on attributes of <command> (credit: hs)
whatwg at whatwg.org
whatwg at whatwg.org
Mon Nov 17 23:16:36 PST 2008
Author: ianh
Date: 2008-11-17 23:16:35 -0800 (Mon, 17 Nov 2008)
New Revision: 2415
Modified:
index
source
Log:
[c] (0) Define better the restrictions on attributes of <command> (credit: hs)
Modified: index
===================================================================
--- index 2008-11-18 04:05:57 UTC (rev 2414)
+++ index 2008-11-18 07:16:35 UTC (rev 2415)
@@ -30610,15 +30610,28 @@
with an associated action, or a state or option that can be toggled,
or a selection of one item from a list of items.</p>
- <!-- XXX this should be an enumerated attribute -->
+ <p>The attribute is an <a href=#enumerated-attribute>enumerated attribute</a> with three
+ keywords and states. The keyword "<dfn id=attr-command-type-keyword-command title=attr-command-type-keyword-command><code>command</code></dfn>"
+ maps to the <a href=#attr-command-type-state-command title=attr-command-type-state-command>Command</a> state, the
+ <dfn id=attr-command-type-keyword-checkbox title=attr-command-type-keyword-checkbox><code>checkbox</code></dfn>"
+ maps to the <a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</a>, and the
+ "<dfn id=attr-command-type-keyword-radio title=attr-command-type-keyword-radio><code>radio</code></dfn>"
+ keyword maps to the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a> state. The
+ <i>missing value default</i> is the <a href=#attr-command-type-state-command title=attr-command-type-state-command>Command</a> state.</p>
- <p>The attribute's value must be either "<code title="">command</code>", "<code title="">checkbox</code>", or
- "<code title="">radio</code>", denoting each of these three types of
- commands respectively. The attribute may also be omitted if the
- element is to represent the first of these types, a simple
- command.</p>
+ <dl><dt>The <dfn id=attr-command-type-state-command title=attr-command-type-state-command>Command</dfn> state</dt>
- <p>The <dfn id=attr-command-label title=attr-command-label><code>label</code></dfn>
+ <dd><p>The element represents a normal command with an associated action.</dd>
+
+ <dt>The <dfn id=attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</dfn> state</dt>
+
+ <dd><p>The element represents a state or option that can be toggled.</dd>
+
+ <dt>The <dfn id=attr-command-type-state-radio title=attr-command-type-state-radio>Radio</dfn> state</dt>
+
+ <dd><p>The element represents a selection of one item from a list of items.</dd>
+
+ </dl><p>The <dfn id=attr-command-label title=attr-command-label><code>label</code></dfn>
attribute gives the name of the command, as shown to the user.</p>
<p>The <dfn id=attr-command-title title=attr-command-title><code>title</code></dfn>
@@ -30645,19 +30658,26 @@
<p>The <dfn id=attr-command-checked title=attr-command-checked><code>checked</code></dfn>
attribute is a <a href=#boolean-attribute>boolean attribute</a> that, if present,
- indicates that the command is selected.</p>
+ indicates that the command is selected. The attribute must be
+ omitted unless the <code title=attr-command-type><a href=#attr-command-type>type</a></code>
+ attribute is in either the <a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</a> state or
+ the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a>
+ state.</p>
<p>The <dfn id=attr-command-radiogroup title=attr-command-radiogroup><code>radiogroup</code></dfn>
attribute gives the name of the group of commands that will be
toggled when the command itself is toggled, for commands whose <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute has the value "<code title="">radio</code>". The scope of the name is the child list of
- the parent element.</p>
+ the parent element. The attribute must be omitted unless the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is in the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a> state.</p>
<p>If the <code><a href=#the-command>command</a></code> element is used when <span title="menu generation">generating</span> a <span>context
menu</span>, then the <dfn id=attr-command-default title=attr-command-default><code>default</code></dfn> attribute
indicates, if present, that the command is the one that would have
been invoked if the user had directly activated the menu's subject
instead of using its context menu. The <code title=attr-command-default><a href=#attr-command-default>default</a></code> attribute is a
- <a href=#boolean-attribute>boolean attribute</a>.</p>
+ <a href=#boolean-attribute>boolean attribute</a>. The attribute must be omitted
+ unless the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
+ in the <a href=#attr-command-type-state-command title=attr-command-type-state-command>Command</a>
+ state.</p>
<div class=example>
@@ -30677,9 +30697,11 @@
method's behavior depends on the value of the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute of the element, as
follows:</p>
- <dl class=switch><dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute
- has the value <code title="">checkbox</code></dt>
+ <!-- XXX should integrate this better with the normal click() method -->
+ <dl class=switch><dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
+ in the <a href=#attr-command-type-state-checkbox title=attr-command-type-state-checkbox>Checkbox</a> state</dt>
+
<dd><p>If the element has a <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code> attribute, the UA must
remove that attribute. Otherwise, the UA must add a <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code> attribute, with the
literal value <code title="">checked</code>. The UA must then
@@ -30687,8 +30709,8 @@
element.</dd>
- <dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute
- has the value <code title="">radio</code></dt>
+ <dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
+ in the <a href=#attr-command-type-state-radio title=attr-command-type-state-radio>Radio</a> state</dt>
<dd><p>If the element has a parent, then the UA must walk the list
of child nodes of that parent element, and for each node that is a
@@ -30712,10 +30734,6 @@
</dl><p class=note>Firing a synthetic <code title=event-click>click</code> event at the element does not cause
any of the actions described above to happen.</p>
- <p class=XXX> should change all the above so it actually is
- just triggered by a click event, then we could remove the shadowing
- click() method and rely on actual events. </p>
-
<p class=XXX>Need to define the command="" attribute</p>
<p class=note><code><a href=#the-command>command</a></code> elements are not rendered
Modified: source
===================================================================
--- source 2008-11-18 04:05:57 UTC (rev 2414)
+++ source 2008-11-18 07:16:35 UTC (rev 2415)
@@ -34765,15 +34765,38 @@
with an associated action, or a state or option that can be toggled,
or a selection of one item from a list of items.</p>
- <!-- XXX this should be an enumerated attribute -->
+ <p>The attribute is an <span>enumerated attribute</span> with three
+ keywords and states. The keyword "<dfn
+ title="attr-command-type-keyword-command"><code>command</code></dfn>"
+ maps to the <span
+ title="attr-command-type-state-command">Command</span> state, the
+ <dfn
+ title="attr-command-type-keyword-checkbox"><code>checkbox</code></dfn>"
+ maps to the <span
+ title="attr-command-type-state-checkbox">Checkbox</span>, and the
+ "<dfn
+ title="attr-command-type-keyword-radio"><code>radio</code></dfn>"
+ keyword maps to the <span
+ title="attr-command-type-state-radio">Radio</span> state. The
+ <i>missing value default</i> is the <span
+ title="attr-command-type-state-command">Command</span> state.</p>
- <p>The attribute's value must be either "<code
- title="">command</code>", "<code title="">checkbox</code>", or
- "<code title="">radio</code>", denoting each of these three types of
- commands respectively. The attribute may also be omitted if the
- element is to represent the first of these types, a simple
- command.</p>
+ <dl>
+ <dt>The <dfn title="attr-command-type-state-command">Command</dfn> state</dt>
+
+ <dd><p>The element represents a normal command with an associated action.</p></dd>
+
+ <dt>The <dfn title="attr-command-type-state-checkbox">Checkbox</dfn> state</dt>
+
+ <dd><p>The element represents a state or option that can be toggled.</p></dd>
+
+ <dt>The <dfn title="attr-command-type-state-radio">Radio</dfn> state</dt>
+
+ <dd><p>The element represents a selection of one item from a list of items.</p></dd>
+
+ </dl>
+
<p>The <dfn title="attr-command-label"><code>label</code></dfn>
attribute gives the name of the command, as shown to the user.</p>
@@ -34804,7 +34827,12 @@
<p>The <dfn title="attr-command-checked"><code>checked</code></dfn>
attribute is a <span>boolean attribute</span> that, if present,
- indicates that the command is selected.</p>
+ indicates that the command is selected. The attribute must be
+ omitted unless the <code title="attr-command-type">type</code>
+ attribute is in either the <span
+ title="attr-command-type-state-checkbox">Checkbox</span> state or
+ the <span title="attr-command-type-state-radio">Radio</span>
+ state.</p>
<p>The <dfn
title="attr-command-radiogroup"><code>radiogroup</code></dfn>
@@ -34812,7 +34840,9 @@
toggled when the command itself is toggled, for commands whose <code
title="attr-command-type">type</code> attribute has the value "<code
title="">radio</code>". The scope of the name is the child list of
- the parent element.</p>
+ the parent element. The attribute must be omitted unless the <code
+ title="attr-command-type">type</code> attribute is in the <span
+ title="attr-command-type-state-radio">Radio</span> state.</p>
<p>If the <code>command</code> element is used when <span
title="menu generation">generating</span> a <span>context
@@ -34822,7 +34852,10 @@
been invoked if the user had directly activated the menu's subject
instead of using its context menu. The <code
title="attr-command-default">default</code> attribute is a
- <span>boolean attribute</span>.</p>
+ <span>boolean attribute</span>. The attribute must be omitted
+ unless the <code title="attr-command-type">type</code> attribute is
+ in the <span title="attr-command-type-state-command">Command</span>
+ state.</p>
<div class="example">
@@ -34848,10 +34881,13 @@
title="attr-command-type">type</code> attribute of the element, as
follows:</p>
+ <!-- XXX should integrate this better with the normal click() method -->
+
<dl class="switch">
- <dt>If the <code title="attr-command-type">type</code> attribute
- has the value <code title="">checkbox</code></dt>
+ <dt>If the <code title="attr-command-type">type</code> attribute is
+ in the <span
+ title="attr-command-type-state-checkbox">Checkbox</span> state</dt>
<dd><p>If the element has a <code
title="attr-command-checked">checked</code> attribute, the UA must
@@ -34862,8 +34898,9 @@
element.</p></dd>
- <dt>If the <code title="attr-command-type">type</code> attribute
- has the value <code title="">radio</code></dt>
+ <dt>If the <code title="attr-command-type">type</code> attribute is
+ in the <span
+ title="attr-command-type-state-radio">Radio</span> state</dt>
<dd><p>If the element has a parent, then the UA must walk the list
of child nodes of that parent element, and for each node that is a
@@ -34894,10 +34931,6 @@
title="event-click">click</code> event at the element does not cause
any of the actions described above to happen.</p>
- <p class="XXX"> should change all the above so it actually is
- just triggered by a click event, then we could remove the shadowing
- click() method and rely on actual events. </p>
-
<p class="XXX">Need to define the command="" attribute</p>
<p class="note"><code>command</code> elements are not rendered
More information about the Commit-Watchers
mailing list