NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 334 - Define better the restrictions on attributes of <command> (credit: hs)
Define better the restrictions on attributes of <command> (credit: hs)
Status: RESOLVED INTENTIONAL
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Nobody
http://svn.whatwg.org/webapps/source?...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-24 22:02 CET by Henri Sivonen
Modified: 2013-06-29 13:31 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henri Sivonen 2008-11-24 22:02:47 CET
Index: source
===================================================================
--- source	(revision 2414)
+++ source	(revision 2415)
@@ -34765,14 +34765,37 @@
   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
Comment 1 Michael[tm] Smith 2013-06-29 13:31:06 CEST
command was dropped from the spec