W3C home > Mailing lists > Public > public-html-commits@w3.org > May 2009

html5/spec Overview.html,1.2221,1.2222

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Sat, 02 May 2009 21:32:00 +0000
To: public-html-commits@w3.org
Message-Id: <E1M0MoS-00040B-CC@lionel-hutz.w3.org>
Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv15369

Modified Files:
	Overview.html 
Log Message:
Change the way the Command API is defined so that it applies to all elements, so that we can make any element a command without jumping through hoops. (whatwg r3063)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.2221
retrieving revision 1.2222
diff -u -d -r1.2221 -r1.2222
--- Overview.html	2 May 2009 20:09:13 -0000	1.2221
+++ Overview.html	2 May 2009 21:31:57 -0000	1.2222
@@ -904,7 +904,7 @@
      <li><a href="#redo:-moving-forward-in-the-undo-transaction-history"><span class="secno">6.10.5 </span>Redo: moving forward in the undo transaction history</a></li>
      <li><a href="#the-undomanagerevent-interface-and-the-undo-and-redo-events"><span class="secno">6.10.6 </span>The <code>UndoManagerEvent</code> interface and the <code title="event-undo">undo</code> and <code title="event-redo">redo</code> events</a></li>
      <li><a href="#implementation-notes"><span class="secno">6.10.7 </span>Implementation notes</a></ol></li>
-   <li><a href="#command-apis"><span class="secno">6.11 </span>Command APIs</a></ol></li>
+   <li><a href="#editing-apis"><span class="secno">6.11 </span>Editing APIs</a></ol></li>
  <li><a href="#comms"><span class="secno">7 </span>Communication</a>
   <ol>
    <li><a href="#event-definitions"><span class="secno">7.1 </span>Event definitions</a></li>
@@ -7093,6 +7093,14 @@
            attribute <a href="#htmlmenuelement">HTMLMenuElement</a> <a href="#dom-contextmenu" title="dom-contextMenu">contextMenu</a>;
            attribute boolean <a href="#dom-spellcheck" title="dom-spellcheck">spellcheck</a>;
 
+  // <a href="#command-api">command API</a>
+  readonly attribute DOMString <a href="#dom-command-ro-commandtype" title="dom-command-ro-commandType">commandType</a>;          
+  readonly attribute DOMString <a href="#dom-command-ro-label" title="dom-command-ro-label">label</a>;
+  readonly attribute DOMString <a href="#dom-command-ro-icon" title="dom-command-ro-icon">icon</a>;
+  readonly attribute boolean <a href="#dom-command-ro-disabled" title="dom-command-ro-disabled">disabled</a>;              
+  readonly attribute boolean <a href="#dom-command-ro-checked" title="dom-command-ro-checked">checked</a>;<!-- v2COMMAND
+  readonly attribute <span>HTMLCollection</span> <span title="dom-command-ro-triggers">triggers</span>;-->
+
   // <span>styling</span>
   readonly attribute <span>CSSStyleDeclaration</span> <a href="#dom-style" title="dom-style">style</a>;
 
@@ -12358,8 +12366,6 @@
            attribute DOMString <a href="#dom-a-search" title="dom-a-search">search</a>;
            attribute DOMString <a href="#dom-a-hash" title="dom-a-hash">hash</a>;
 };</pre>
-    <p>The <code title="command-ro"><a href="#command-ro">Command</a></code> interface must also be implemented by
-    this element.</p>
    </dd>
   </dl><p>If the <code><a href="#the-a-element">a</a></code> element has an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute, then it
   <a href="#represents">represents</a> a <a href="#hyperlink">hyperlink</a> (a hypertext
@@ -34451,10 +34457,8 @@
            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 <a href="#dom-command-default" title="dom-command-default">default</a>;
- void <a href="#dom-command-click" title="dom-command-click">click</a>(); // shadows <code><a href="#htmlelement">HTMLElement</a></code>.<code title="dom-click"><a href="#dom-click">click()</a></code>
+  void <a href="#dom-command-click" title="dom-command-click">click</a>(); // shadows <code><a href="#htmlelement">HTMLElement</a></code>.<code title="dom-click"><a href="#dom-click">click()</a></code>
 };</pre>
-    <p>The <code title="command-ro"><a href="#command-ro">Command</a></code> interface must also be implemented by
-    this element.</p>
    </dd>
   </dl><p>The <code><a href="#the-command">command</a></code> element represents a command that the user
   can invoke.<p>The <dfn id="attr-command-type" title="attr-command-type"><code>type</code></dfn>
@@ -34596,8 +34600,6 @@
   readonly attribute boolean <a href="#dom-bb-supported" title="dom-bb-supported">supported</a>;
   readonly attribute boolean <a href="#dom-bb-disabled" title="dom-bb-disabled">disabled</a>;
 };</pre>
-    <p>The <code title="command-ro"><a href="#command-ro">Command</a></code> interface must also
-    be implemented by this element.</p>
    </dd>
   </dl><p>The <code><a href="#the-bb-element">bb</a></code> element represents a user agent command that
   the user can invoke.<p>The <dfn id="attr-bb-type" title="attr-bb-type"><code>type</code></dfn> attribute
@@ -35103,36 +35105,8 @@
    way to refer to it.</dd>
 -->
 
-  </dl><p>Commands are represented by elements in the DOM. Any element that
-  can define a command also implements the <code title="command-ro"><a href="#command-ro">Command</a></code> interface:<p class="XXX">Actually even better would be to just mix it
-  straight into those interfaces somehow.<pre class="idl">[NoInterfaceObject] interface <dfn id="command-ro" title="command-ro">Command</dfn> {<!--
- NOTE: to avoid clashing with the HTMLCommandElement interface's names,
-       the members of this interface use cross-references with the title
-       dom-command-ro-foo (note the "ro", which stands for "readonly").
--->
-  readonly attribute DOMString <a href="#dom-command-ro-commandtype" title="dom-command-ro-commandType">commandType</a>;          
-  readonly attribute DOMString <a href="#dom-command-ro-id" title="dom-command-ro-id">id</a>;
-  readonly attribute DOMString <a href="#dom-command-ro-label" title="dom-command-ro-label">label</a>;
-  readonly attribute DOMString <a href="#dom-command-ro-title" title="dom-command-ro-title">title</a>;
-  readonly attribute DOMString <a href="#dom-command-ro-icon" title="dom-command-ro-icon">icon</a>;
-  readonly attribute boolean <a href="#dom-command-ro-hidden" title="dom-command-ro-hidden">hidden</a>;
-  readonly attribute boolean <a href="#dom-command-ro-disabled" title="dom-command-ro-disabled">disabled</a>;              
-  readonly attribute boolean <a href="#dom-command-ro-checked" title="dom-command-ro-checked">checked</a>;              
-  void <a href="#dom-command-ro-click" title="dom-command-ro-click">click</a>();<!-- v2COMMAND
-  readonly attribute <span>HTMLCollection</span> <span title="dom-command-ro-triggers">triggers</span>;-->
-};</pre><div class="impl">
-
-  <p>The <code title="command-ro"><a href="#command-ro">Command</a></code> interface must be
-  implemented by any element capable of defining a command. All the
-  attributes of the <code title="command-ro"><a href="#command-ro">Command</a></code> interface
-  are read-only. Elements implementing this interface might implement
-  other interfaces that have attributes with identical names but that
-  are mutable; in bindings that flatten all supported interfaces on
-  the object, the mutable attributes must shadow the readonly
-  attributes defined in the <code title="command-ro"><a href="#command-ro">Command</a></code>
-  interface.</p>
-
-  </div><dl class="domintro"><dt><var title="">element</var> . <code title="dom-command-ro-commandType"><a href="#dom-command-ro-commandtype">commandType</a></code></dt>
+  </dl><p>These facets are exposed on elements using the <dfn id="command-api">command
+  API</dfn>:<dl class="domintro"><dt><var title="">element</var> . <code title="dom-command-ro-commandType"><a href="#dom-command-ro-commandtype">commandType</a></code></dt>
 
    <dd>
 
@@ -35140,7 +35114,7 @@
 
    </dd>
 
-   <dt><var title="">element</var> . <code title="dom-command-ro-id"><a href="#dom-command-ro-id">id</a></code></dt>
+   <dt><var title="">element</var> . <code title="dom-id"><a href="#dom-id">id</a></code></dt>
 
    <dd>
 
@@ -35156,7 +35130,7 @@
 
    </dd>
 
-   <dt><var title="">element</var> . <code title="dom-command-ro-title"><a href="#dom-command-ro-title">title</a></code></dt>
+   <dt><var title="">element</var> . <code title="dom-title"><a href="#dom-title">title</a></code></dt>
 
    <dd>
 
@@ -35172,7 +35146,7 @@
 
    </dd>
 
-   <dt><var title="">element</var> . <code title="dom-command-ro-hidden"><a href="#dom-command-ro-hidden">hidden</a></code></dt>
+   <dt><var title="">element</var> . <code title="dom-hidden"><a href="#dom-hidden">hidden</a></code></dt>
 
    <dd>
 
@@ -35196,7 +35170,7 @@
 
    </dd>
 
-   <dt><var title="">element</var> . <code title="dom-command-ro-click"><a href="#dom-command-ro-click">click</a></code></dt>
+   <dt><var title="">element</var> . <code title="dom-click"><a href="#dom-click">click</a></code>()</dt>
 
    <dd>
 
@@ -35221,25 +35195,12 @@
   element is "command", "radio", or "checked" respectively. If the
   element does not define a command, it must return null.</p>
 
-  <p>The <dfn id="dom-command-ro-id" title="dom-command-ro-id"><code>id</code></dfn> attribute
-  must return the command's <a href="#command-facet-id" title="command-facet-ID">ID</a>,
-  or null if the element does not define a command or defines an
-  <a href="#anonymous-command">anonymous command</a>. This attribute will be shadowed by
-  the <code title="dom-id"><a href="#dom-id">id</a></code> DOM attribute on the
-  <code><a href="#htmlelement">HTMLElement</a></code> interface.</p>
-
   <p>The <dfn id="dom-command-ro-label" title="dom-command-ro-label"><code>label</code></dfn>
   attribute must return the command's <a href="#command-facet-label" title="command-facet-Label">Label</a>, or null if the element
   does not define a command or does not specify a <a href="#command-facet-label" title="command-facet-Label">Label</a>. This attribute will be
   shadowed by the <code title="">label</code> DOM attribute on
   <code><a href="#the-option-element">option</a></code> and <code><a href="#the-command">command</a></code> elements.</p>
 
-  <p>The <dfn id="dom-command-ro-title" title="dom-command-ro-title"><code>title</code></dfn>
-  attribute must return the command's <a href="#command-facet-hint" title="command-facet-Hint">Hint</a>, or null if the element does
-  not define a command or does not specify a <a href="#command-facet-hint" title="command-facet-Hint">Hint</a>. This attribute will be
-  shadowed by the <code title="dom-title"><a href="#dom-title">title</a></code> DOM attribute
-  on the <code><a href="#htmlelement">HTMLElement</a></code> interface.</p>
-
   <p>The <dfn id="dom-command-ro-icon" title="dom-command-ro-icon"><code>icon</code></dfn>
   attribute must return the <a href="#absolute-url">absolute URL</a> of the command's
   <a href="#command-facet-icon" title="command-facet-Icon">Icon</a>. If the element does
@@ -35248,13 +35209,6 @@
   by the <code title="dom-command-icon"><a href="#dom-command-icon">icon</a></code> DOM attribute on
   <code><a href="#the-command">command</a></code> elements.</p>
 
-  <p>The <dfn id="dom-command-ro-hidden" title="dom-command-ro-hidden"><code>hidden</code></dfn>
-  attribute must return true if the command's <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a> is that the
-  command is hidden, and false if it is that the command is not
-  hidden. If the element does not define a command, the attribute must
-  return false. This attribute will be shadowed by the <code title="dom-hidden"><a href="#dom-hidden">hidden</a></code> DOM attribute on the
-  <code><a href="#htmlelement">HTMLElement</a></code> interface.</p>
-
   <p>The <dfn id="dom-command-ro-disabled" title="dom-command-ro-disabled"><code>disabled</code></dfn>
   attribute must return true if the command's <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled State</a> is that
   the command is disabled, and false if the command is not
@@ -35271,11 +35225,6 @@
   must return false. This attribute will be shadowed by the <code title="">checked</code> attribute on <code><a href="#the-input-element">input</a></code> and
   <code><a href="#the-command">command</a></code> elements.</p>
 
-  <p>The <dfn id="dom-command-ro-click" title="dom-command-ro-click"><code>click()</code></dfn>
-  method must trigger the <a href="#command-facet-action" title="command-facet-Action">Action</a> for the command. If the
-  element does not define a command, this method must do nothing. This
-  method will be shadowed by the <code title="dom-click"><a href="#dom-click">click()</a></code> method on <a href="#html-elements">HTML
-  elements</a>, and is included only for completeness.</p>
 <!--v2COMMAND
   <p>The <dfn
   title="dom-command-ro-triggers"><code>triggers</code></dfn>
@@ -35285,13 +35234,30 @@
   <span>live</span>. While the element does not define a command, the
   list must be empty.</p>
 -->
+
+  <p class="note">The <a href="#command-facet-id" title="command-facet-ID">ID</a> facet
+  is exposed by the the <code title="dom-id"><a href="#dom-id">id</a></code> DOM attribute,
+  the <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> facet is exposed by
+  the <code title="dom-title"><a href="#dom-title">title</a></code> DOM attribute, and the
+  <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a> facet is
+  exposed by the <code title="dom-hidden"><a href="#dom-hidden">hidden</a></code> DOM
+  attribute.</p>
+
+  </div><hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-images"><a href="#dom-document-images">images</a></code></dt>
+   <dd>
+    <p>Returns an <code><a href="#htmlcollection-0">HTMLCollection</a></code> of the elements in the
+    <code>Document</code> that define commands and have IDs.</p>
+   </dd>
+
+  </dl><div class="impl">
+
   <p>The <dfn id="dom-document-commands" title="dom-document-commands"><code>commands</code></dfn> attribute
   of the document's <code><a href="#htmldocument">HTMLDocument</a></code> interface must return an
   <code><a href="#htmlcollection-0">HTMLCollection</a></code> rooted at the <code>Document</code>
   node, whose filter matches only elements that define commands and
   have IDs.</p>
 
-  </div><p>The following elements can define commands: <code title="a-command"><a href="#using-the-a-element-to-define-a-command">a</a></code>, <code title="button-command"><a href="#using-the-button-element-to-define-a-command">button</a></code>, <code title="input-command"><a href="#using-the-input-element-to-define-a-command">input</a></code>, <code title="option-command"><a href="#using-the-option-element-to-define-a-command">option</a></code>, <code title="command-element"><a href="#using-the-command-element-to-define-a-command">command</a></code>, <code title="bb-command"><a href="#using-the-bb-element-to-define-a-command">bb</a></code>.<div class="impl">
+  </div><div class="impl">
 
   <h5 id="using-the-a-element-to-define-a-command"><span class="secno">4.11.6.1 </span><dfn title="a-command">Using the <code>a</code> element to define a command</dfn></h5>
 
@@ -45606,7 +45572,7 @@
   described in this section, however, such that to a script there is
   no detectable difference.</p>
 
-  </div><h3 id="command-apis"><span class="secno">6.11 </span>Command APIs</h3><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-execCommand"><a href="#execCommand">execCommand</a></code>(<var title="">commandId</var> [, <var title="">showUI</var> [, <var title="">value</var> ] ] )</dt>
+  </div><h3 id="editing-apis"><span class="secno">6.11 </span>Editing APIs</h3><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-execCommand"><a href="#execCommand">execCommand</a></code>(<var title="">commandId</var> [, <var title="">showUI</var> [, <var title="">value</var> ] ] )</dt>
 
    <dd>
 
Received on Saturday, 2 May 2009 21:32:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 2 May 2009 21:32:10 GMT