[html5] r3063 - [] (0) Change the way the Command API is defined so that it applies to all eleme [...]
whatwg at whatwg.org
whatwg at whatwg.org
Sat May 2 14:31:52 PDT 2009
Author: ianh
Date: 2009-05-02 14:31:50 -0700 (Sat, 02 May 2009)
New Revision: 3063
Modified:
index
source
Log:
[] (0) 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.
Modified: index
===================================================================
--- index 2009-05-02 20:09:06 UTC (rev 3062)
+++ index 2009-05-02 21:31:50 UTC (rev 3063)
@@ -844,7 +844,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>
@@ -7809,6 +7809,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>;
@@ -14057,8 +14065,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
@@ -38632,10 +38638,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>
@@ -38809,8 +38813,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>
@@ -39405,43 +39407,9 @@
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>
+ </dl><p>These facets are exposed on elements using the <dfn id=command-api>command
+ API</dfn>:</p>
- <p class=XXX>Actually even better would be to just mix it
- straight into those interfaces somehow.</p>
-
- <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>
<dd>
@@ -39450,7 +39418,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>
@@ -39466,7 +39434,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>
@@ -39482,7 +39450,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>
@@ -39506,7 +39474,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>
@@ -39531,25 +39499,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
@@ -39558,13 +39513,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
@@ -39581,11 +39529,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>
@@ -39595,6 +39538,25 @@
<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>
@@ -39603,10 +39565,8 @@
</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>.</p>
-
<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>
@@ -51043,7 +51003,7 @@
- <h3 id=command-apis><span class=secno>6.11 </span>Command APIs</h3>
+ <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>
Modified: source
===================================================================
--- source 2009-05-02 20:09:06 UTC (rev 3062)
+++ source 2009-05-02 21:31:50 UTC (rev 3063)
@@ -8028,6 +8028,14 @@
attribute <span>HTMLMenuElement</span> <span title="dom-contextMenu">contextMenu</span>;
attribute boolean <span title="dom-spellcheck">spellcheck</span>;
+ // <span>command API</span>
+ readonly attribute DOMString <span title="dom-command-ro-commandType">commandType</span>;
+ readonly attribute DOMString <span title="dom-command-ro-label">label</span>;
+ readonly attribute DOMString <span title="dom-command-ro-icon">icon</span>;
+ readonly attribute boolean <span title="dom-command-ro-disabled">disabled</span>;
+ readonly attribute boolean <span title="dom-command-ro-checked">checked</span>;<!-- v2COMMAND
+ readonly attribute <span>HTMLCollection</span> <span title="dom-command-ro-triggers">triggers</span>;-->
+
// <span>styling</span>
readonly attribute <span>CSSStyleDeclaration</span> <span title="dom-style">style</span>;
@@ -15026,8 +15034,6 @@
attribute DOMString <span title="dom-a-search">search</span>;
attribute DOMString <span title="dom-a-hash">hash</span>;
};</pre>
- <p>The <code title="command-ro">Command</code> interface must also be implemented by
- this element.</p>
</dd>
</dl>
@@ -43502,10 +43508,8 @@
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>;
- void <span title="dom-command-click">click</span>(); // shadows <code>HTMLElement</code>.<code title="dom-click">click()</code>
+ void <span title="dom-command-click">click</span>(); // shadows <code>HTMLElement</code>.<code title="dom-click">click()</code>
};</pre>
- <p>The <code title="command-ro">Command</code> interface must also be implemented by
- this element.</p>
</dd>
</dl>
@@ -43724,8 +43728,6 @@
readonly attribute boolean <span title="dom-bb-supported">supported</span>;
readonly attribute boolean <span title="dom-bb-disabled">disabled</span>;
};</pre>
- <p>The <code title="command-ro">Command</code> interface must also
- be implemented by this element.</p>
</dd>
</dl>
@@ -44387,44 +44389,9 @@
</dl>
- <p>Commands are represented by elements in the DOM. Any element that
- can define a command also implements the <code
- title="command-ro">Command</code> interface:</p>
+ <p>These facets are exposed on elements using the <dfn>command
+ API</dfn>:</p>
- <p class="XXX">Actually even better would be to just mix it
- straight into those interfaces somehow.</p>
-
- <pre class="idl">[NoInterfaceObject] interface <dfn 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 <span title="dom-command-ro-commandType">commandType</span>;
- readonly attribute DOMString <span title="dom-command-ro-id">id</span>;
- readonly attribute DOMString <span title="dom-command-ro-label">label</span>;
- readonly attribute DOMString <span title="dom-command-ro-title">title</span>;
- readonly attribute DOMString <span title="dom-command-ro-icon">icon</span>;
- readonly attribute boolean <span title="dom-command-ro-hidden">hidden</span>;
- readonly attribute boolean <span title="dom-command-ro-disabled">disabled</span>;
- readonly attribute boolean <span title="dom-command-ro-checked">checked</span>;
- void <span title="dom-command-ro-click">click</span>();<!-- v2COMMAND
- readonly attribute <span>HTMLCollection</span> <span title="dom-command-ro-triggers">triggers</span>;-->
-};</pre>
-
- <div class="impl">
-
- <p>The <code title="command-ro">Command</code> interface must be
- implemented by any element capable of defining a command. All the
- attributes of the <code title="command-ro">Command</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">Command</code>
- interface.</p>
-
- </div>
-
<dl class="domintro">
<dt><var title="">element</var> . <code title="dom-command-ro-commandType">commandType</code></dt>
@@ -44435,7 +44402,7 @@
</dd>
- <dt><var title="">element</var> . <code title="dom-command-ro-id">id</code></dt>
+ <dt><var title="">element</var> . <code title="dom-id">id</code></dt>
<dd>
@@ -44451,7 +44418,7 @@
</dd>
- <dt><var title="">element</var> . <code title="dom-command-ro-title">title</code></dt>
+ <dt><var title="">element</var> . <code title="dom-title">title</code></dt>
<dd>
@@ -44467,7 +44434,7 @@
</dd>
- <dt><var title="">element</var> . <code title="dom-command-ro-hidden">hidden</code></dt>
+ <dt><var title="">element</var> . <code title="dom-hidden">hidden</code></dt>
<dd>
@@ -44491,7 +44458,7 @@
</dd>
- <dt><var title="">element</var> . <code title="dom-command-ro-click">click</code></dt>
+ <dt><var title="">element</var> . <code title="dom-click">click</code>()</dt>
<dd>
@@ -44522,13 +44489,6 @@
element is "command", "radio", or "checked" respectively. If the
element does not define a command, it must return null.</p>
- <p>The <dfn title="dom-command-ro-id"><code>id</code></dfn> attribute
- must return the command's <span title="command-facet-ID">ID</span>,
- or null if the element does not define a command or defines an
- <span>anonymous command</span>. This attribute will be shadowed by
- the <code title="dom-id">id</code> DOM attribute on the
- <code>HTMLElement</code> interface.</p>
-
<p>The <dfn title="dom-command-ro-label"><code>label</code></dfn>
attribute must return the command's <span
title="command-facet-Label">Label</span>, or null if the element
@@ -44537,14 +44497,6 @@
shadowed by the <code title="">label</code> DOM attribute on
<code>option</code> and <code>command</code> elements.</p>
- <p>The <dfn title="dom-command-ro-title"><code>title</code></dfn>
- attribute must return the command's <span
- title="command-facet-Hint">Hint</span>, or null if the element does
- not define a command or does not specify a <span
- title="command-facet-Hint">Hint</span>. This attribute will be
- shadowed by the <code title="dom-title">title</code> DOM attribute
- on the <code>HTMLElement</code> interface.</p>
-
<p>The <dfn title="dom-command-ro-icon"><code>icon</code></dfn>
attribute must return the <span>absolute URL</span> of the command's
<span title="command-facet-Icon">Icon</span>. If the element does
@@ -44553,15 +44505,6 @@
by the <code title="dom-command-icon">icon</code> DOM attribute on
<code>command</code> elements.</p>
- <p>The <dfn title="dom-command-ro-hidden"><code>hidden</code></dfn>
- attribute must return true if the command's <span
- title="command-facet-HiddenState">Hidden State</span> 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">hidden</code> DOM attribute on the
- <code>HTMLElement</code> interface.</p>
-
<p>The <dfn
title="dom-command-ro-disabled"><code>disabled</code></dfn>
attribute must return true if the command's <span
@@ -44585,13 +44528,6 @@
title="">checked</code> attribute on <code>input</code> and
<code>command</code> elements.</p>
- <p>The <dfn title="dom-command-ro-click"><code>click()</code></dfn>
- method must trigger the <span
- title="command-facet-Action">Action</span> 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">click()</code> method on <span>HTML
- elements</span>, and is included only for completeness.</p>
<!--v2COMMAND
<p>The <dfn
title="dom-command-ro-triggers"><code>triggers</code></dfn>
@@ -44601,6 +44537,31 @@
<span>live</span>. While the element does not define a command, the
list must be empty.</p>
-->
+
+ <p class="note">The <span title="command-facet-ID">ID</span> facet
+ is exposed by the the <code title="dom-id">id</code> DOM attribute,
+ the <span title="command-facet-Hint">Hint</span> facet is exposed by
+ the <code title="dom-title">title</code> DOM attribute, and the
+ <span title="command-facet-HiddenState">Hidden State</span> facet is
+ exposed by the <code title="dom-hidden">hidden</code> DOM
+ attribute.</p>
+
+ </div>
+
+ <hr>
+
+ <dl class="domintro">
+
+ <dt><var title="">document</var> . <code title="dom-document-images">images</code></dt>
+ <dd>
+ <p>Returns an <code>HTMLCollection</code> of the elements in the
+ <code>Document</code> that define commands and have IDs.</p>
+ </dd>
+
+ </dl>
+
+ <div class="impl">
+
<p>The <dfn
title="dom-document-commands"><code>commands</code></dfn> attribute
of the document's <code>HTMLDocument</code> interface must return an
@@ -44610,16 +44571,8 @@
</div>
- <p>The following elements can define commands: <code
- title="a-command">a</code>, <code
- title="button-command">button</code>, <code
- title="input-command">input</code>, <code
- title="option-command">option</code>, <code
- title="command-element">command</code>, <code
- title="bb-command">bb</code>.</p>
-
<div class="impl">
<h5><dfn title="a-command">Using the <code>a</code> element to define a command</dfn></h5>
@@ -59570,7 +59523,7 @@
- <h3>Command APIs</h3>
+ <h3>Editing APIs</h3>
<dl class="domintro">
More information about the Commit-Watchers
mailing list