[html5] r6995 - [acgiow] (0) Define <command command='foo'> to reference other commands Affected [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Feb 14 16:30:12 PST 2012


Author: ianh
Date: 2012-02-14 16:30:08 -0800 (Tue, 14 Feb 2012)
New Revision: 6995

Modified:
   complete.html
   index
   source
Log:
[acgiow] (0) Define <command command='foo'> to reference other commands
Affected topics: DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2012-02-14 20:29:01 UTC (rev 6994)
+++ complete.html	2012-02-15 00:30:08 UTC (rev 6995)
@@ -240,7 +240,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 14 February 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 15 February 2012</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -757,9 +757,10 @@
        <li><a href=#using-the-option-element-to-define-a-command><span class=secno>4.11.5.4 </span>Using the <code>option</code> element to define a command</a></li>
        <li><a href=#using-the-command-element-to-define-a-command><span class=secno>4.11.5.5 </span>Using the <code>command</code> element to define
   a command</a></li>
-       <li><a href=#using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.6 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</a></li>
-       <li><a href=#using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.7 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</a></li>
-       <li><a href=#using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.8 </span>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</a></ol></ol></li>
+       <li><a href=#using-the-command-attribute-on-command-elements-to-define-a-command-indirectly><span class=secno>4.11.5.6 </span>Using the <code title=attr-command-command>command</code> attribute on <code>command</code> elements to define a command indirectly</a></li>
+       <li><a href=#using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.7 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</a></li>
+       <li><a href=#using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.8 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</a></li>
+       <li><a href=#using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.9 </span>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</a></ol></ol></li>
    <li><a href=#links><span class=secno>4.12 </span>Links</a>
     <ol>
      <li><a href=#introduction-3><span class=secno>4.12.1 </span>Introduction</a></li>
@@ -53236,6 +53237,7 @@
    <dd><code title=attr-command-checked><a href=#attr-command-checked>checked</a></code></dd>
    <dd><code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code></dd>
    <!--<dd><code title="attr-command-default">default</code></dd>-->
+   <dd><code title=attr-command-command><a href=#attr-command-command>command</a></code></dd>
    <dd>Also, the <code title=attr-command-title><a href=#attr-command-title>title</a></code> attribute has special semantics on this element.</dd>
    <dt><a href=#element-dfn-dom title=element-dfn-dom>DOM interface</a>:</dt><!--TOPIC:DOM APIs-->
    <dd>
@@ -53247,18 +53249,34 @@
            attribute boolean <a href=#dom-command-checked title=dom-command-checked>checked</a>;
            attribute DOMString <a href=#dom-command-radiogroup title=dom-command-radiogroup>radiogroup</a>;<!--
            attribute boolean <span title="dom-command-default">default</span>;-->
+  readonly attribute <a href=#htmlelement>HTMLElement</a>? <a href=#dom-command-command title=dom-command-command>command</a>;
 };</pre>
    </dd>
   </dl><!--TOPIC:HTML--><p>The <code><a href=#the-command-element>command</a></code> element represents a command that the user
   can invoke.</p>
 
-  <p>A command can be part of a context menu or toolbar, using the
-  <code><a href=#the-menu-element>menu</a></code> element, or can be put anywhere else in the page,
-  to define a keyboard shortcut.</p> <!-- in the future we'll also add
-  a command="" attribute to refer to a command, which can then be
-  defined anywhere -->
+  <p>A command can be explicitly part of a context menu or toolbar,
+  using the <code><a href=#the-menu-element>menu</a></code> element. It can also be put anywhere
+  else on a page, either just to define a keyboard shortcut, or to
+  define a command that is then referenced from other
+  <code><a href=#the-command-element>command</a></code> elements.</p>
 
-  <p>The <dfn id=attr-command-type title=attr-command-type><code>type</code></dfn>
+  <p>A <code><a href=#the-command-element>command</a></code> element that uses the
+  <code title=attr-command-type><a href=#attr-command-type>type</a></code>,
+  <code title=attr-command-label><a href=#attr-command-label>label</a></code>,
+  <code title=attr-command-icon><a href=#attr-command-icon>icon</a></code>,
+  <code title=attr-command-disabled><a href=#attr-command-disabled>disabled</a></code>,
+  <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code>,
+  <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code>,
+  <!--<code title="attr-command-default">default</code>,--> and
+  <code title=attr-title><a href=#the-title-attribute>title</a></code> attributes defines a new
+  command. A <code><a href=#the-command-element>command</a></code> element that uses the <code title=attr-command-command><a href=#attr-command-command>command</a></code> <em>attribute</em>
+  defines a command by reference to another one. This allows authors
+  to define a command once, and set its state (e.g. whether it is
+  active or disabled) in one place, and have all references to that
+  command in the user interface change at the same time.</p>
+
+  <hr><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>
@@ -53357,8 +53375,30 @@
   </div>
 -->
 
-  <div class=impl>
+  <hr><p>If a <code><a href=#the-command-element>command</a></code> element <var title="">slave</var> has a
+  <dfn id=attr-command-command title=attr-command-command><code>command</code></dfn>
+  attribute, and <var title="">slave</var> is <a href=#in-a-document>in a
+  <code>Document</code></a>, and there is an element in that
+  <code><a href=#document>Document</a></code> whose <a href=#concept-id title=concept-id>ID</a> has a
+  value equal to the value of <var title="">slave</var>'s <code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute, and the first
+  such element in <a href=#tree-order>tree order</a>, hereafter <var title="">master</var>, itself <a href=#concept-command title=concept-command>defines
+  a command</a> and either is not a <code><a href=#the-command-element>command</a></code> element or
+  does not itself have a <code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute, then the
+  <dfn id=master-command>master command</dfn> of <var title="">slave</var> is <var title="">master</var>.</p>
 
+  <p>An element with a
+  <code title=attr-command-command><a href=#attr-command-command>command</a></code>
+  attribute must have a <a href=#master-command>master command</a> and must not have any
+  <code title=attr-command-type><a href=#attr-command-type>type</a></code>,
+  <code title=attr-command-label><a href=#attr-command-label>label</a></code>,
+  <code title=attr-command-icon><a href=#attr-command-icon>icon</a></code>,
+  <code title=attr-command-disabled><a href=#attr-command-disabled>disabled</a></code>,
+  <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code>, or
+  <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code>
+  attributes.</p>
+
+  <hr><div class=impl>
+
   <p>The <dfn id=dom-command-type title=dom-command-type><code>type</code></dfn> IDL
   attribute must <a href=#reflect>reflect</a> the content attribute of the
   same name, <a href=#limited-to-only-known-values>limited to only known values</a>.</p>
@@ -53368,11 +53408,22 @@
   IDL attributes must <a href=#reflect>reflect</a> the respective content
   attributes of the same name.</p>
 
-  <p>The element's <a href=#activation-behavior>activation behavior</a> 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>
+  <p>The <dfn id=dom-command-command title=dom-command-command><code>command</code></dfn>
+  IDL attribute must return the <a href=#master-command>master command</a>, if any,
+  or null otherwise.</p>
 
-  <dl class=switch><dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
+  <hr><p>The element's <a href=#activation-behavior>activation behavior</a> depends on the
+  element's <code title=attr-command-type><a href=#attr-command-type>type</a></code> and <code title=attr-command-command><a href=#attr-command-command>command</a></code> attributes, as
+  follows:</p>
+
+  <dl class=switch><dt>If the element has a <a href=#master-command>master command</a> set by its
+   <code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute</dt>
+
+   <dd><p>The user agent must <a href=#run-synthetic-click-activation-steps>run synthetic click activation
+   steps</a> on the element's <a href=#master-command>master command</a>.</dd>
+
+
+   <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
@@ -54221,10 +54272,11 @@
   element.</p>
 
 
+
   <h5 id=using-the-command-element-to-define-a-command><span class=secno>4.11.5.5 </span>Using the <dfn title=command-element><code>command</code></dfn> element to define
   a command</h5>
 
-  <p>A <code><a href=#the-command-element>command</a></code> element <a href=#concept-command title=concept-command>defines a command</a>.</p>
+  <p>A <code><a href=#the-command-element>command</a></code> element that does not have a <code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute <a href=#concept-command title=concept-command>defines a command</a>.</p>
 
   <p>The <a href=#command-facet-type title=command-facet-Type>Type</a> of the command
   is "radio" if the <code><a href=#the-command-element>command</a></code>'s <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
@@ -54276,10 +54328,57 @@
 
 
 
+  <h5 id=using-the-command-attribute-on-command-elements-to-define-a-command-indirectly><span class=secno>4.11.5.6 </span><dfn title=command-command-command>Using the <code title=attr-command-command>command</code> attribute on <code>command</code> elements to define a command indirectly</dfn></h5>
 
+  <p>A <code><a href=#the-command-element>command</a></code> element with a <a href=#master-command>master command</a>
+  <a href=#concept-command title=concept-command>defines a command</a>.</p>
 
-  <h5 id=using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.6 </span><dfn title=label-command>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</dfn></h5>
+  <p>The <a href=#command-facet-type title=command-facet-Type>Type</a> of the command
+  is the <a href=#command-facet-type title=command-facet-Type>Type</a> of the
+  <a href=#master-command>master command</a>.</p>
 
+  <p>The <a href=#command-facet-id title=command-facet-ID>ID</a> of the command is
+  the value of the <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute of the
+  element, if the attribute is present and not empty. Otherwise the
+  command is an <a href=#anonymous-command>anonymous command</a>.</p>
+
+  <p>The <a href=#command-facet-label title=command-facet-Label>Label</a> of the command
+  is the <a href=#command-facet-label title=command-facet-Label>Label</a> of the
+  <a href=#master-command>master command</a>.</p>
+
+  <p>If the element has a <code title=attr-title><a href=#the-title-attribute>title</a></code>
+  attribute, then the <a href=#command-facet-hint title=command-facet-Hint>Hint</a> of
+  the command is the value of that <code title=attr-title><a href=#the-title-attribute>title</a></code> attribute. Otherwise, the <a href=#command-facet-hint title=command-facet-Hint>Hint</a> of the command is the <a href=#command-facet-hint title=command-facet-Hint>Hint</a> of the <a href=#master-command>master
+  command</a>.</p>
+
+  <p>The <a href=#command-facet-icon title=command-facet-Icon>Icon</a> of the command
+  is the <a href=#command-facet-icon title=command-facet-Icon>Icon</a> of the
+  <a href=#master-command>master command</a>.</p>
+
+  <p>The <a href=#command-facet-accesskey title=command-facet-AccessKey>AccessKey</a> of the
+  command is the element's <a href=#assigned-access-key>assigned access key</a>, if
+  any.</p>
+
+  <p>The <a href=#command-facet-hiddenstate title=command-facet-HiddenState>Hidden State</a>
+  of the command is the <a href=#command-facet-hiddenstate title=command-facet-HiddenState>Hidden
+  State</a> of the <a href=#master-command>master command</a>.</p>
+
+  <p>The <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled
+  State</a> of the command is the <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled State</a> of the
+  <a href=#master-command>master command</a>.</p>
+
+  <p>The <a href=#command-facet-checkedstate title=command-facet-CheckedState>Checked
+  State</a> of the command is the <a href=#command-facet-checkedstate title=command-facet-CheckedState>Checked State</a> of the
+  <a href=#master-command>master command</a>.</p>
+
+  <p>The <a href=#command-facet-action title=command-facet-Action>Action</a> of the
+  command is to invoke the <a href=#command-facet-action title=command-facet-Action>Action</a> of the <a href=#master-command>master
+  command</a>.</p>
+
+
+
+  <h5 id=using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.7 </span><dfn title=label-command>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</dfn></h5>
+
   <p>A <code><a href=#the-label-element>label</a></code> element that has an <a href=#assigned-access-key>assigned access
   key</a> and a <a href=#labeled-control>labeled control</a> and whose
   <a href=#labeled-control>labeled control</a> <a href=#concept-command title=concept-command>defines a
@@ -54319,7 +54418,7 @@
 
 
 
-  <h5 id=using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.7 </span><dfn title=legend-command>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</dfn></h5>
+  <h5 id=using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.8 </span><dfn title=legend-command>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</dfn></h5>
 
   <p>A <code><a href=#the-legend-element>legend</a></code> element that has an <a href=#assigned-access-key>assigned access
   key</a> and is a child of a <code><a href=#the-fieldset-element>fieldset</a></code> element that
@@ -54363,14 +54462,14 @@
 
 
 
-  <h5 id=using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.8 </span><dfn title=accesskey-command>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</dfn></h5>
+  <h5 id=using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.9 </span><dfn title=accesskey-command>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</dfn></h5>
 
   <p>An element that has an <a href=#assigned-access-key>assigned access key</a> <a href=#concept-command title=concept-command>defines a command</a>.</p>
 
-  <p>If one of the other sections that define elements that <a href=#concept-command title=concept-command>define commands</a> define that this
+  <p>If one of the earlier sections that define elements that <a href=#concept-command title=concept-command>define commands</a> define that this
   element <a href=#concept-command title=concept-command>defines a command</a>, then
-  that section applies to this element, and this section does
-  not. Otherwise, this section applies to that element.</p>
+  that section applies to this element, and this section does not.
+  Otherwise, this section applies to that element.</p>
 
   <p>The <a href=#command-facet-type title=command-facet-Type>Type</a> of the command
   is "command".</p>
@@ -94865,7 +94964,8 @@
          <code title=attr-command-icon><a href=#attr-command-icon>icon</a></code>;
          <code title=attr-command-disabled><a href=#attr-command-disabled>disabled</a></code>;
          <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code>;
-         <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code></td>
+         <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code>;
+         <code title=attr-command-command><a href=#attr-command-command>command</a></code></td>
      <td><code><a href=#htmlcommandelement>HTMLCommandElement</a></code></td>
     </tr><!--DATA--><!--FORK--><tr><th><code><a href=#the-data-element>data</a></code></th>
      <td>Machine-readable equivalent</td>
@@ -96248,6 +96348,10 @@
           <code title=attr-tdth-colspan><a href=#attr-tdth-colspan>th</a></code>
      <td> Number of columns that the cell is to span
      <td> <a href=#valid-non-negative-integer>Valid non-negative integer</a> greater than zero
+    <tr><th> <code title="">command</code>
+     <td> <code title=attr-command-command><a href=#attr-command-command>command</a></code>
+     <td> Command definition
+     <td> <a href=#concept-id title=concept-id>ID</a>*
     <tr><th> <code title="">content</code>
      <td> <code title=attr-meta-content><a href=#attr-meta-content>meta</a></code>
      <td> Value of the element

Modified: index
===================================================================
--- index	2012-02-14 20:29:01 UTC (rev 6994)
+++ index	2012-02-15 00:30:08 UTC (rev 6995)
@@ -240,7 +240,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 14 February 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 15 February 2012</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -757,9 +757,10 @@
        <li><a href=#using-the-option-element-to-define-a-command><span class=secno>4.11.5.4 </span>Using the <code>option</code> element to define a command</a></li>
        <li><a href=#using-the-command-element-to-define-a-command><span class=secno>4.11.5.5 </span>Using the <code>command</code> element to define
   a command</a></li>
-       <li><a href=#using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.6 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</a></li>
-       <li><a href=#using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.7 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</a></li>
-       <li><a href=#using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.8 </span>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</a></ol></ol></li>
+       <li><a href=#using-the-command-attribute-on-command-elements-to-define-a-command-indirectly><span class=secno>4.11.5.6 </span>Using the <code title=attr-command-command>command</code> attribute on <code>command</code> elements to define a command indirectly</a></li>
+       <li><a href=#using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.7 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</a></li>
+       <li><a href=#using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.8 </span>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</a></li>
+       <li><a href=#using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.9 </span>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</a></ol></ol></li>
    <li><a href=#links><span class=secno>4.12 </span>Links</a>
     <ol>
      <li><a href=#introduction-3><span class=secno>4.12.1 </span>Introduction</a></li>
@@ -53236,6 +53237,7 @@
    <dd><code title=attr-command-checked><a href=#attr-command-checked>checked</a></code></dd>
    <dd><code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code></dd>
    <!--<dd><code title="attr-command-default">default</code></dd>-->
+   <dd><code title=attr-command-command><a href=#attr-command-command>command</a></code></dd>
    <dd>Also, the <code title=attr-command-title><a href=#attr-command-title>title</a></code> attribute has special semantics on this element.</dd>
    <dt><a href=#element-dfn-dom title=element-dfn-dom>DOM interface</a>:</dt><!--TOPIC:DOM APIs-->
    <dd>
@@ -53247,18 +53249,34 @@
            attribute boolean <a href=#dom-command-checked title=dom-command-checked>checked</a>;
            attribute DOMString <a href=#dom-command-radiogroup title=dom-command-radiogroup>radiogroup</a>;<!--
            attribute boolean <span title="dom-command-default">default</span>;-->
+  readonly attribute <a href=#htmlelement>HTMLElement</a>? <a href=#dom-command-command title=dom-command-command>command</a>;
 };</pre>
    </dd>
   </dl><!--TOPIC:HTML--><p>The <code><a href=#the-command-element>command</a></code> element represents a command that the user
   can invoke.</p>
 
-  <p>A command can be part of a context menu or toolbar, using the
-  <code><a href=#the-menu-element>menu</a></code> element, or can be put anywhere else in the page,
-  to define a keyboard shortcut.</p> <!-- in the future we'll also add
-  a command="" attribute to refer to a command, which can then be
-  defined anywhere -->
+  <p>A command can be explicitly part of a context menu or toolbar,
+  using the <code><a href=#the-menu-element>menu</a></code> element. It can also be put anywhere
+  else on a page, either just to define a keyboard shortcut, or to
+  define a command that is then referenced from other
+  <code><a href=#the-command-element>command</a></code> elements.</p>
 
-  <p>The <dfn id=attr-command-type title=attr-command-type><code>type</code></dfn>
+  <p>A <code><a href=#the-command-element>command</a></code> element that uses the
+  <code title=attr-command-type><a href=#attr-command-type>type</a></code>,
+  <code title=attr-command-label><a href=#attr-command-label>label</a></code>,
+  <code title=attr-command-icon><a href=#attr-command-icon>icon</a></code>,
+  <code title=attr-command-disabled><a href=#attr-command-disabled>disabled</a></code>,
+  <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code>,
+  <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code>,
+  <!--<code title="attr-command-default">default</code>,--> and
+  <code title=attr-title><a href=#the-title-attribute>title</a></code> attributes defines a new
+  command. A <code><a href=#the-command-element>command</a></code> element that uses the <code title=attr-command-command><a href=#attr-command-command>command</a></code> <em>attribute</em>
+  defines a command by reference to another one. This allows authors
+  to define a command once, and set its state (e.g. whether it is
+  active or disabled) in one place, and have all references to that
+  command in the user interface change at the same time.</p>
+
+  <hr><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>
@@ -53357,8 +53375,30 @@
   </div>
 -->
 
-  <div class=impl>
+  <hr><p>If a <code><a href=#the-command-element>command</a></code> element <var title="">slave</var> has a
+  <dfn id=attr-command-command title=attr-command-command><code>command</code></dfn>
+  attribute, and <var title="">slave</var> is <a href=#in-a-document>in a
+  <code>Document</code></a>, and there is an element in that
+  <code><a href=#document>Document</a></code> whose <a href=#concept-id title=concept-id>ID</a> has a
+  value equal to the value of <var title="">slave</var>'s <code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute, and the first
+  such element in <a href=#tree-order>tree order</a>, hereafter <var title="">master</var>, itself <a href=#concept-command title=concept-command>defines
+  a command</a> and either is not a <code><a href=#the-command-element>command</a></code> element or
+  does not itself have a <code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute, then the
+  <dfn id=master-command>master command</dfn> of <var title="">slave</var> is <var title="">master</var>.</p>
 
+  <p>An element with a
+  <code title=attr-command-command><a href=#attr-command-command>command</a></code>
+  attribute must have a <a href=#master-command>master command</a> and must not have any
+  <code title=attr-command-type><a href=#attr-command-type>type</a></code>,
+  <code title=attr-command-label><a href=#attr-command-label>label</a></code>,
+  <code title=attr-command-icon><a href=#attr-command-icon>icon</a></code>,
+  <code title=attr-command-disabled><a href=#attr-command-disabled>disabled</a></code>,
+  <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code>, or
+  <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code>
+  attributes.</p>
+
+  <hr><div class=impl>
+
   <p>The <dfn id=dom-command-type title=dom-command-type><code>type</code></dfn> IDL
   attribute must <a href=#reflect>reflect</a> the content attribute of the
   same name, <a href=#limited-to-only-known-values>limited to only known values</a>.</p>
@@ -53368,11 +53408,22 @@
   IDL attributes must <a href=#reflect>reflect</a> the respective content
   attributes of the same name.</p>
 
-  <p>The element's <a href=#activation-behavior>activation behavior</a> 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>
+  <p>The <dfn id=dom-command-command title=dom-command-command><code>command</code></dfn>
+  IDL attribute must return the <a href=#master-command>master command</a>, if any,
+  or null otherwise.</p>
 
-  <dl class=switch><dt>If the <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
+  <hr><p>The element's <a href=#activation-behavior>activation behavior</a> depends on the
+  element's <code title=attr-command-type><a href=#attr-command-type>type</a></code> and <code title=attr-command-command><a href=#attr-command-command>command</a></code> attributes, as
+  follows:</p>
+
+  <dl class=switch><dt>If the element has a <a href=#master-command>master command</a> set by its
+   <code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute</dt>
+
+   <dd><p>The user agent must <a href=#run-synthetic-click-activation-steps>run synthetic click activation
+   steps</a> on the element's <a href=#master-command>master command</a>.</dd>
+
+
+   <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
@@ -54221,10 +54272,11 @@
   element.</p>
 
 
+
   <h5 id=using-the-command-element-to-define-a-command><span class=secno>4.11.5.5 </span>Using the <dfn title=command-element><code>command</code></dfn> element to define
   a command</h5>
 
-  <p>A <code><a href=#the-command-element>command</a></code> element <a href=#concept-command title=concept-command>defines a command</a>.</p>
+  <p>A <code><a href=#the-command-element>command</a></code> element that does not have a <code title=attr-command-command><a href=#attr-command-command>command</a></code> attribute <a href=#concept-command title=concept-command>defines a command</a>.</p>
 
   <p>The <a href=#command-facet-type title=command-facet-Type>Type</a> of the command
   is "radio" if the <code><a href=#the-command-element>command</a></code>'s <code title=attr-command-type><a href=#attr-command-type>type</a></code> attribute is
@@ -54276,10 +54328,57 @@
 
 
 
+  <h5 id=using-the-command-attribute-on-command-elements-to-define-a-command-indirectly><span class=secno>4.11.5.6 </span><dfn title=command-command-command>Using the <code title=attr-command-command>command</code> attribute on <code>command</code> elements to define a command indirectly</dfn></h5>
 
+  <p>A <code><a href=#the-command-element>command</a></code> element with a <a href=#master-command>master command</a>
+  <a href=#concept-command title=concept-command>defines a command</a>.</p>
 
-  <h5 id=using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.6 </span><dfn title=label-command>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</dfn></h5>
+  <p>The <a href=#command-facet-type title=command-facet-Type>Type</a> of the command
+  is the <a href=#command-facet-type title=command-facet-Type>Type</a> of the
+  <a href=#master-command>master command</a>.</p>
 
+  <p>The <a href=#command-facet-id title=command-facet-ID>ID</a> of the command is
+  the value of the <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute of the
+  element, if the attribute is present and not empty. Otherwise the
+  command is an <a href=#anonymous-command>anonymous command</a>.</p>
+
+  <p>The <a href=#command-facet-label title=command-facet-Label>Label</a> of the command
+  is the <a href=#command-facet-label title=command-facet-Label>Label</a> of the
+  <a href=#master-command>master command</a>.</p>
+
+  <p>If the element has a <code title=attr-title><a href=#the-title-attribute>title</a></code>
+  attribute, then the <a href=#command-facet-hint title=command-facet-Hint>Hint</a> of
+  the command is the value of that <code title=attr-title><a href=#the-title-attribute>title</a></code> attribute. Otherwise, the <a href=#command-facet-hint title=command-facet-Hint>Hint</a> of the command is the <a href=#command-facet-hint title=command-facet-Hint>Hint</a> of the <a href=#master-command>master
+  command</a>.</p>
+
+  <p>The <a href=#command-facet-icon title=command-facet-Icon>Icon</a> of the command
+  is the <a href=#command-facet-icon title=command-facet-Icon>Icon</a> of the
+  <a href=#master-command>master command</a>.</p>
+
+  <p>The <a href=#command-facet-accesskey title=command-facet-AccessKey>AccessKey</a> of the
+  command is the element's <a href=#assigned-access-key>assigned access key</a>, if
+  any.</p>
+
+  <p>The <a href=#command-facet-hiddenstate title=command-facet-HiddenState>Hidden State</a>
+  of the command is the <a href=#command-facet-hiddenstate title=command-facet-HiddenState>Hidden
+  State</a> of the <a href=#master-command>master command</a>.</p>
+
+  <p>The <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled
+  State</a> of the command is the <a href=#command-facet-disabledstate title=command-facet-DisabledState>Disabled State</a> of the
+  <a href=#master-command>master command</a>.</p>
+
+  <p>The <a href=#command-facet-checkedstate title=command-facet-CheckedState>Checked
+  State</a> of the command is the <a href=#command-facet-checkedstate title=command-facet-CheckedState>Checked State</a> of the
+  <a href=#master-command>master command</a>.</p>
+
+  <p>The <a href=#command-facet-action title=command-facet-Action>Action</a> of the
+  command is to invoke the <a href=#command-facet-action title=command-facet-Action>Action</a> of the <a href=#master-command>master
+  command</a>.</p>
+
+
+
+  <h5 id=using-the-accesskey-attribute-on-a-label-element-to-define-a-command><span class=secno>4.11.5.7 </span><dfn title=label-command>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>label</code> element to define a command</dfn></h5>
+
   <p>A <code><a href=#the-label-element>label</a></code> element that has an <a href=#assigned-access-key>assigned access
   key</a> and a <a href=#labeled-control>labeled control</a> and whose
   <a href=#labeled-control>labeled control</a> <a href=#concept-command title=concept-command>defines a
@@ -54319,7 +54418,7 @@
 
 
 
-  <h5 id=using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.7 </span><dfn title=legend-command>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</dfn></h5>
+  <h5 id=using-the-accesskey-attribute-on-a-legend-element-to-define-a-command><span class=secno>4.11.5.8 </span><dfn title=legend-command>Using the <code title=attr-accesskey>accesskey</code> attribute on a <code>legend</code> element to define a command</dfn></h5>
 
   <p>A <code><a href=#the-legend-element>legend</a></code> element that has an <a href=#assigned-access-key>assigned access
   key</a> and is a child of a <code><a href=#the-fieldset-element>fieldset</a></code> element that
@@ -54363,14 +54462,14 @@
 
 
 
-  <h5 id=using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.8 </span><dfn title=accesskey-command>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</dfn></h5>
+  <h5 id=using-the-accesskey-attribute-to-define-a-command-on-other-elements><span class=secno>4.11.5.9 </span><dfn title=accesskey-command>Using the <code title=attr-accesskey>accesskey</code> attribute to define a command on other elements</dfn></h5>
 
   <p>An element that has an <a href=#assigned-access-key>assigned access key</a> <a href=#concept-command title=concept-command>defines a command</a>.</p>
 
-  <p>If one of the other sections that define elements that <a href=#concept-command title=concept-command>define commands</a> define that this
+  <p>If one of the earlier sections that define elements that <a href=#concept-command title=concept-command>define commands</a> define that this
   element <a href=#concept-command title=concept-command>defines a command</a>, then
-  that section applies to this element, and this section does
-  not. Otherwise, this section applies to that element.</p>
+  that section applies to this element, and this section does not.
+  Otherwise, this section applies to that element.</p>
 
   <p>The <a href=#command-facet-type title=command-facet-Type>Type</a> of the command
   is "command".</p>
@@ -94865,7 +94964,8 @@
          <code title=attr-command-icon><a href=#attr-command-icon>icon</a></code>;
          <code title=attr-command-disabled><a href=#attr-command-disabled>disabled</a></code>;
          <code title=attr-command-checked><a href=#attr-command-checked>checked</a></code>;
-         <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code></td>
+         <code title=attr-command-radiogroup><a href=#attr-command-radiogroup>radiogroup</a></code>;
+         <code title=attr-command-command><a href=#attr-command-command>command</a></code></td>
      <td><code><a href=#htmlcommandelement>HTMLCommandElement</a></code></td>
     </tr><!--DATA--><!--FORK--><tr><th><code><a href=#the-data-element>data</a></code></th>
      <td>Machine-readable equivalent</td>
@@ -96248,6 +96348,10 @@
           <code title=attr-tdth-colspan><a href=#attr-tdth-colspan>th</a></code>
      <td> Number of columns that the cell is to span
      <td> <a href=#valid-non-negative-integer>Valid non-negative integer</a> greater than zero
+    <tr><th> <code title="">command</code>
+     <td> <code title=attr-command-command><a href=#attr-command-command>command</a></code>
+     <td> Command definition
+     <td> <a href=#concept-id title=concept-id>ID</a>*
     <tr><th> <code title="">content</code>
      <td> <code title=attr-meta-content><a href=#attr-meta-content>meta</a></code>
      <td> Value of the element

Modified: source
===================================================================
--- source	2012-02-14 20:29:01 UTC (rev 6994)
+++ source	2012-02-15 00:30:08 UTC (rev 6995)
@@ -62118,6 +62118,7 @@
    <dd><code title="attr-command-checked">checked</code></dd>
    <dd><code title="attr-command-radiogroup">radiogroup</code></dd>
    <!--<dd><code title="attr-command-default">default</code></dd>-->
+   <dd><code title="attr-command-command">command</code></dd>
    <dd>Also, the <code title="attr-command-title">title</code> attribute has special semantics on this element.</dd>
    <dt><span title="element-dfn-dom">DOM interface</span>:</dt><!--TOPIC:DOM APIs-->
    <dd>
@@ -62129,6 +62130,7 @@
            attribute boolean <span title="dom-command-checked">checked</span>;
            attribute DOMString <span title="dom-command-radiogroup">radiogroup</span>;<!--
            attribute boolean <span title="dom-command-default">default</span>;-->
+  readonly attribute <span>HTMLElement</span>? <span title="dom-command-command">command</span>;
 };</pre>
    </dd>
   </dl><!--TOPIC:HTML-->
@@ -62136,12 +62138,30 @@
   <p>The <code>command</code> element represents a command that the user
   can invoke.</p>
 
-  <p>A command can be part of a context menu or toolbar, using the
-  <code>menu</code> element, or can be put anywhere else in the page,
-  to define a keyboard shortcut.</p> <!-- in the future we'll also add
-  a command="" attribute to refer to a command, which can then be
-  defined anywhere -->
+  <p>A command can be explicitly part of a context menu or toolbar,
+  using the <code>menu</code> element. It can also be put anywhere
+  else on a page, either just to define a keyboard shortcut, or to
+  define a command that is then referenced from other
+  <code>command</code> elements.</p>
 
+  <p>A <code>command</code> element that uses the
+  <code title="attr-command-type">type</code>,
+  <code title="attr-command-label">label</code>,
+  <code title="attr-command-icon">icon</code>,
+  <code title="attr-command-disabled">disabled</code>,
+  <code title="attr-command-checked">checked</code>,
+  <code title="attr-command-radiogroup">radiogroup</code>,
+  <!--<code title="attr-command-default">default</code>,--> and
+  <code title="attr-title">title</code> attributes defines a new
+  command. A <code>command</code> element that uses the <code
+  title="attr-command-command">command</code> <em>attribute</em>
+  defines a command by reference to another one. This allows authors
+  to define a command once, and set its state (e.g. whether it is
+  active or disabled) in one place, and have all references to that
+  command in the user interface change at the same time.</p>
+
+  <hr>
+
   <p>The <dfn 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,
@@ -62261,6 +62281,36 @@
   </div>
 -->
 
+  <hr>
+
+  <p>If a <code>command</code> element <var title="">slave</var> has a
+  <dfn title="attr-command-command"><code>command</code></dfn>
+  attribute, and <var title="">slave</var> is <span>in a
+  <code>Document</code></span>, and there is an element in that
+  <code>Document</code> whose <span title="concept-id">ID</span> has a
+  value equal to the value of <var title="">slave</var>'s <code
+  title="attr-command-command">command</code> attribute, and the first
+  such element in <span>tree order</span>, hereafter <var
+  title="">master</var>, itself <span title="concept-command">defines
+  a command</span> and either is not a <code>command</code> element or
+  does not itself have a <code
+  title="attr-command-command">command</code> attribute, then the
+  <dfn>master command</dfn> of <var title="">slave</var> is <var
+  title="">master</var>.</p>
+
+  <p>An element with a
+  <code title="attr-command-command">command</code>
+  attribute must have a <span>master command</span> and must not have any
+  <code title="attr-command-type">type</code>,
+  <code title="attr-command-label">label</code>,
+  <code title="attr-command-icon">icon</code>,
+  <code title="attr-command-disabled">disabled</code>,
+  <code title="attr-command-checked">checked</code>, or
+  <code title="attr-command-radiogroup">radiogroup</code>
+  attributes.</p>
+
+  <hr>
+
   <div class="impl">
 
   <p>The <dfn title="dom-command-type"><code>type</code></dfn> IDL
@@ -62276,12 +62326,26 @@
   IDL attributes must <span>reflect</span> the respective content
   attributes of the same name.</p>
 
+  <p>The <dfn title="dom-command-command"><code>command</code></dfn>
+  IDL attribute must return the <span>master command</span>, if any,
+  or null otherwise.</p>
+
+  <hr>
+  
   <p>The element's <span>activation behavior</span> depends on the
-  value of the <code title="attr-command-type">type</code> attribute
-  of the element, as follows:</p>
+  element's <code title="attr-command-type">type</code> and <code
+  title="attr-command-command">command</code> attributes, as
+  follows:</p>
 
   <dl class="switch">
 
+   <dt>If the element has a <span>master command</span> set by its
+   <code title="attr-command-command">command</code> attribute</dt>
+
+   <dd><p>The user agent must <span>run synthetic click activation
+   steps</span> on the element's <span>master command</span>.</p></dd>
+
+
    <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>
@@ -63277,11 +63341,13 @@
   element.</p>
 
 
+
   <h5>Using the <dfn
   title="command-element"><code>command</code></dfn> element to define
   a command</h5>
 
-  <p>A <code>command</code> element <span
+  <p>A <code>command</code> element that does not have a <code
+  title="attr-command-command">command</code> attribute <span
   title="concept-command">defines a command</span>.</p>
 
   <p>The <span title="command-facet-Type">Type</span> of the command
@@ -63341,8 +63407,61 @@
 
 
 
+  <h5><dfn title="command-command-command">Using the <code title="attr-command-command">command</code> attribute on <code>command</code> elements to define a command indirectly</dfn></h5>
 
+  <p>A <code>command</code> element with a <span>master command</span>
+  <span title="concept-command">defines a command</span>.</p>
 
+  <p>The <span title="command-facet-Type">Type</span> of the command
+  is the <span title="command-facet-Type">Type</span> of the
+  <span>master command</span>.</p>
+
+  <p>The <span title="command-facet-ID">ID</span> of the command is
+  the value of the <code title="attr-id">id</code> attribute of the
+  element, if the attribute is present and not empty. Otherwise the
+  command is an <span>anonymous command</span>.</p>
+
+  <p>The <span title="command-facet-Label">Label</span> of the command
+  is the <span title="command-facet-Label">Label</span> of the
+  <span>master command</span>.</p>
+
+  <p>If the element has a <code title="attr-title">title</code>
+  attribute, then the <span title="command-facet-Hint">Hint</span> of
+  the command is the value of that <code
+  title="attr-title">title</code> attribute. Otherwise, the <span
+  title="command-facet-Hint">Hint</span> of the command is the <span
+  title="command-facet-Hint">Hint</span> of the <span>master
+  command</span>.</p>
+
+  <p>The <span title="command-facet-Icon">Icon</span> of the command
+  is the <span title="command-facet-Icon">Icon</span> of the
+  <span>master command</span>.</p>
+
+  <p>The <span title="command-facet-AccessKey">AccessKey</span> of the
+  command is the element's <span>assigned access key</span>, if
+  any.</p>
+
+  <p>The <span title="command-facet-HiddenState">Hidden State</span>
+  of the command is the <span title="command-facet-HiddenState">Hidden
+  State</span> of the <span>master command</span>.</p>
+
+  <p>The <span title="command-facet-DisabledState">Disabled
+  State</span> of the command is the <span
+  title="command-facet-DisabledState">Disabled State</span> of the
+  <span>master command</span>.</p>
+
+  <p>The <span title="command-facet-CheckedState">Checked
+  State</span> of the command is the <span
+  title="command-facet-CheckedState">Checked State</span> of the
+  <span>master command</span>.</p>
+
+  <p>The <span title="command-facet-Action">Action</span> of the
+  command is to invoke the <span
+  title="command-facet-Action">Action</span> of the <span>master
+  command</span>.</p>
+
+
+
   <h5><dfn title="label-command">Using the <code title="attr-accesskey">accesskey</code> attribute on a <code>label</code> element to define a command</dfn></h5>
 
   <p>A <code>label</code> element that has an <span>assigned access
@@ -63436,11 +63555,11 @@
   <p>An element that has an <span>assigned access key</span> <span
   title="concept-command">defines a command</span>.</p>
 
-  <p>If one of the other sections that define elements that <span
+  <p>If one of the earlier sections that define elements that <span
   title="concept-command">define commands</span> define that this
   element <span title="concept-command">defines a command</span>, then
-  that section applies to this element, and this section does
-  not. Otherwise, this section applies to that element.</p>
+  that section applies to this element, and this section does not.
+  Otherwise, this section applies to that element.</p>
 
   <p>The <span title="command-facet-Type">Type</span> of the command
   is "command".</p>
@@ -110775,7 +110894,8 @@
          <code title="attr-command-icon">icon</code>;
          <code title="attr-command-disabled">disabled</code>;
          <code title="attr-command-checked">checked</code>;
-         <code title="attr-command-radiogroup">radiogroup</code></td>
+         <code title="attr-command-radiogroup">radiogroup</code>;
+         <code title="attr-command-command">command</code></td>
      <td><code>HTMLCommandElement</code></td>
     </tr>
 
@@ -112454,6 +112574,11 @@
      <td> Number of columns that the cell is to span
      <td> <span>Valid non-negative integer</span> greater than zero
     <tr>
+     <th> <code title="">command</code>
+     <td> <code title="attr-command-command">command</code>
+     <td> Command definition
+     <td> <span title="concept-id">ID</span>*
+    <tr>
      <th> <code title="">content</code>
      <td> <code title="attr-meta-content">meta</code>
      <td> Value of the element




More information about the Commit-Watchers mailing list