spec/Overview.html 1.1587 2415 Define better the restrictions on attrib

Define better the restrictions on attributes of <command> (credit: hs)
(whatwg r2415)

default
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-default
click()
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#dom-command-click
checked
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-checked
type
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-type
label
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-label
radio
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-type-keyword-radio
Radio
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-type-state-radio
icon
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-icon
command
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-type-keyword-command
default
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#dom-command-default
checkbox
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-type-keyword-checkbox
Checkbox
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-type-state-checkbox
disabled
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-disabled
4.11.4 The bb element
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#the-bb-element
Command
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-type-state-command
title
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-title
radiogroup
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1587.html#attr-command-radiogroup

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1586&r2=1.1587&f=h
http://html5.org/tools/web-apps-tracker?from=2414&to=2415

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1586
retrieving revision 1.1587
diff -u -d -r1.1586 -r1.1587
--- Overview.html 18 Nov 2008 04:06:01 -0000 1.1586
+++ Overview.html 18 Nov 2008 07:16:39 -0000 1.1587
@@ -24921,11 +24921,26 @@
   can invoke.<p>The <dfn id=attr-command-type title=attr-command-type><code>type</code></dfn>
   attribute indicates the kind of command: either a normal command
   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'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>The <dfn id=attr-command-label title=attr-command-label><code>label</code></dfn>
+  or a selection of one item from a list of items.<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.<dl><dt>The <dfn id=attr-command-type-state-command title=attr-command-type-state-command>Command</dfn> state</dt>
+
+   <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>The <dfn id=attr-command-title title=attr-command-title><code>title</code></dfn>
   attribute gives a hint describing the command, which might be shown
   to the user to help him.<p>The <dfn id=attr-command-icon title=attr-command-icon><code>icon</code></dfn>
@@ -24942,15 +24957,22 @@
   the command "eat" would be marked hidden since the faucet could
   never be eaten.<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>The <dfn id=attr-command-radiogroup title=attr-command-radiogroup><code>radiogroup</code></dfn>
+  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>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>If the <code><a href=#the-command>command</a></code> element is used when <span title="menu generation">generating</span> a <span>context
+  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>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>.<div class=example>
+  <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.<div class=example>
 
    <p class=XXX>Need an example that shows an element that, if
    double-clicked, invokes an action, but that also has a context
@@ -24962,8 +24984,8 @@
   attributes must <a href=#reflect>reflect</a> the respective content
   attributes of the same name.<p>The <dfn id=dom-command-click title=dom-command-click><code>click()</code></dfn>
   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:<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>
+  follows:</p><!-- 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
@@ -24972,8 +24994,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
@@ -24995,9 +25017,7 @@
    event</a> at the element.</dd>
 
   </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 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 class=XXX>Need to define the command="" attribute<p class=note><code><a href=#the-command>command</a></code> elements are not rendered
+  any of the actions described above to happen.<p class=XXX>Need to define the command="" attribute<p class=note><code><a href=#the-command>command</a></code> elements are not rendered
   unless they <a href=#menus title=menu>form part of a menu</a>.<h4 id=the-bb-element><span class=secno>4.11.4 </span>The <dfn><code>bb</code></dfn> element</h4><dl class=element><dt>Categories</dt>
    <dd><a href=#phrasing-content-0>Phrasing content</a>.</dd>
    <dd><a href=#interactive-content-0>Interactive content</a>.</dd>

Received on Tuesday, 18 November 2008 07:20:22 UTC