[html5] r1354 - /

whatwg at whatwg.org whatwg at whatwg.org
Thu Mar 6 18:21:26 PST 2008


Author: ianh
Date: 2008-03-06 18:21:25 -0800 (Thu, 06 Mar 2008)
New Revision: 1354

Modified:
   index
   source
Log:
[e] (0) Move the Command APIs section down to below the Selection APIs

Modified: index
===================================================================
--- index	2008-03-07 02:19:32 UTC (rev 1353)
+++ index	2008-03-07 02:21:25 UTC (rev 1354)
@@ -1420,17 +1420,17 @@
         </span>Implementation notes</a>
       </ul>
 
-     <li><a href="#command"><span class=secno>5.5 </span>Command APIs</a>
-
-     <li><a href="#selection"><span class=secno>5.6 </span>The text selection
+     <li><a href="#selection"><span class=secno>5.5 </span>The text selection
       APIs</a>
       <ul class=toc>
-       <li><a href="#documentSelection"><span class=secno>5.6.1 </span>APIs
+       <li><a href="#documentSelection"><span class=secno>5.5.1 </span>APIs
         for the browsing context selection</a>
 
-       <li><a href="#textFieldSelection"><span class=secno>5.6.2 </span>APIs
+       <li><a href="#textFieldSelection"><span class=secno>5.5.2 </span>APIs
         for the text field selections</a>
       </ul>
+
+     <li><a href="#command"><span class=secno>5.6 </span>Command APIs</a>
     </ul>
 
    <li><a href="#comms"><span class=secno>6. </span>Communication</a>
@@ -35187,192 +35187,8 @@
    history</a> described in this section, however, such that to a script
    there is no detectable difference.
 
-  <h3 id=command><span class=secno>5.5 </span>Command APIs</h3>
+  <h3 id=selection><span class=secno>5.5 </span>The text selection APIs</h3>
 
-  <p>The <dfn id=execCommand
-   title=dom-document-execCommand><code>execCommand(<var
-   title="">commandId</var>, <var title="">doShowUI</var>, <var
-   title="">value</var>)</code></dfn> method on the <code><a
-   href="#htmldocument">HTMLDocument</a></code> interface allows scripts to
-   perform actions on the <a href="#a-selection" title="the
-   selection">current selection</a> or at the current caret position.
-   Generally, these commands would be used to implement editor UI, for
-   example having a "delete" button on a toolbar.
-
-  <p>There are three variants to this method, with one, two, and three
-   arguments respectively. The <var title="">doShowUI</var> and <var
-   title="">value</var> parameters, even if specified, are ignored unless
-   otherwise stated.
-
-  <p class=note>In this specification, in fact, the <var
-   title="">doShowUI</var> parameter is always ignored, regardless of its
-   value. It is included for historical reasons only.
-
-  <p>When any of these methods are invoked, user agents must act as described
-   in the list below.
-
-  <p>For actions marked "<dfn id=editing2>editing hosts only</dfn>", if the
-   selection is not entirely within an <a href="#editing1">editing host</a>,
-   of if there is no selection and the caret is not inside an <a
-   href="#editing1">editing host</a>, then the user agent must do nothing.
-
-  <dl>
-   <dt>If the <var title="">commandId</var> is <dfn id=undo1
-    title=command-undo><code>undo</code></dfn>
-
-   <dd>The user agent must <a href="#undo-moving0" title=do-undo>move back
-    one step</a> in its <a href="#undo-transaction">undo transaction
-    history</a>, restoring the associated state. If there is no further undo
-    information the user agent must do nothing. See the <a
-    href="#undo-history">undo history</a>.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=redo0
-    title=command-redo><code>redo</code></dfn>
-
-   <dd>The user agent must <a href="#redo-moving0" title=do-redo>move forward
-    one step</a> in its <a href="#undo-transaction">undo transaction
-    history</a>, restoring the associated state. If there is no further undo
-    (well, "redo") information the user agent must do nothing. See the <a
-    href="#undo-history">undo history</a>.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=selectall0
-    title=command-selectAll><code>selectAll</code></dfn>
-
-   <dd>The user agent must change the selection so that all the content in
-    the currently focused <a href="#editing1">editing host</a> is selected.
-    If no <a href="#editing1">editing host</a> is focused, then the content
-    of the entire document must be selected.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=unselect
-    title=command-unselect><code>unselect</code></dfn>
-
-   <dd>
-    <p>The user agent must change the selection so that nothing is selected.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=superscript
-    title=command-superscript><code>superscript</code></dfn>
-
-   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
-    must act as if the user had requested that the selection <a
-    href="#contenteditable-wrapSemantic">be wrapped in the semantics</a> of
-    the <code><a href="#sup">sup</a></code> element (or unwrapped, or, if
-    there is no selection, have that semantic inserted or removed — the
-    exact behaviour is UA-defined).
-
-   <dt>If the <var title="">commandId</var> is <dfn id=subscript
-    title=command-subscript><code>subscript</code></dfn>
-
-   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
-    must act as if the user had requested that the selection <a
-    href="#contenteditable-wrapSemantic">be wrapped in the semantics</a> of
-    the <em title=""><code><a href="#sub">sub</a></code></em> element (or,
-    again, unwrapped, or have that semantic inserted or removed, as defined
-    by the UA).
-
-   <dt>If the <var title="">commandId</var> is <dfn id=formatblock
-    title=command-formatBlock><code>formatBlock</code></dfn>
-
-   <dd>
-    <p><em><a href="#editing2">Editing hosts only.</a></em> This command
-     changes the semantics of the blocks containing the selection.</p>
-
-    <p>If there is no selection, then, where in the description below refers
-     to the selection, the user agent must act as if the selection was an
-     empty range at the caret position.</p>
-
-    <p>If the <var title="">value</var> parameter is not specified or has a
-     value other than one of the following literal strings:</p>
-
-    <ul class=brief>
-     <li><code title=""><address></code>
-
-     <li><code title=""><aside></code>
-
-     <li><code title=""><h1></code>
-
-     <li><code title=""><h2></code>
-
-     <li><code title=""><h3></code>
-
-     <li><code title=""><h4></code>
-
-     <li><code title=""><h5></code>
-
-     <li><code title=""><h6></code>
-
-     <li><code title=""><nav></code>
-
-     <li><code title=""><p></code>
-
-     <li><code title=""><pre></code></li>
-     <!-- XXX this list is incomplete -->
-    </ul>
-
-    <p>...then the user agent must do nothing.</p>
-
-    <p>Otherwise, the user agent must, for every position in the selection,
-     take the furthest <a href="#flow-content0">flow content</a> ancestor
-     element of that position that contains only <a
-     href="#phrasing0">phrasing content</a>, and, if that element is a
-     descendant of the editing host, rename it (as if the <code
-     title="">Element.renameNode()</code> method had been used) according to
-     the <var title="">value</var>, by stripping the leading
-     <code><</code> character and the trailing <code>></code> character
-     and using the rest as the new tag name, using the HTML namespace.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=delete
-    title=command-delete><code>delete</code></dfn>
-
-   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
-    must act as if the user had performed <a href="#contenteditable-delete">a
-    backspace operation</a>.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=forwarddelete
-    title=command-forwardDelete><code>forwardDelete</code></dfn>
-
-   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
-    must act as if the user had performed <a href="#contenteditable-delete">a
-    forward delete operation</a>.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=insertlinebreak
-    title=command-insertLineBreak><code>insertLineBreak</code></dfn>
-
-   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
-    must act as if the user had <a href="#contenteditable-br">requested a
-    line separator</a>.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=insertparagraph
-    title=command-insertParagraph><code>insertParagraph</code></dfn>
-
-   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
-    must act as if the user had performed a <a
-    href="#contenteditable-breakBlock">break block</a> editing action.
-
-   <dt>If the <var title="">commandId</var> is <dfn id=inserttext
-    title=command-insertText><code>insertText</code></dfn>
-
-   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
-    must act as if the user had <a
-    href="#contenteditable-insertText">inserted text</a> corresponding to the
-    <var title="">value</var> parameter.
-
-   <dt>If the <var title="">commandId</var> is <code><var
-    title="">vendorID</var>-<var title="">customCommandID</var></code>
-
-   <dd>User agents may implement vendor-specific extensions to this API.
-    Vendor-specific extensions to the list of commands should use the syntax
-    <code><var title="">vendorID</var>-<var
-    title="">customCommandID</var></code> so as to prevent clashes between
-    extensions from different vendors and future additions to this
-    specification.
-
-   <dt>If the <var title="">commandId</var> is something else
-
-   <dd>User agents must do nothing.
-  </dl>
-
-  <h3 id=selection><span class=secno>5.6 </span>The text selection APIs</h3>
-
   <p>Every <a href="#browsing0">browsing context</a> has <dfn id=a-selection
    title="the selection">a selection</dfn>. The selection can be empty, and
    the selection can have more than one range (a disjointed selection). The
@@ -35428,7 +35244,7 @@
    href="#selection1">::selection</a></code> pseudo-element. <a
    href="#refsSELECTORS">[SELECTORS]</a> <a href="#refsCSS21">[CSS21]</a>
 
-  <h4 id=documentSelection><span class=secno>5.6.1 </span>APIs for the
+  <h4 id=documentSelection><span class=secno>5.5.1 </span>APIs for the
    browsing context selection</h4>
 
   <p>The <dfn id=getselection
@@ -35637,7 +35453,7 @@
    interface has no relation to the <code><a
    href="#datagridselection">DataGridSelection</a></code> interface.
 
-  <h4 id=textFieldSelection><span class=secno>5.6.2 </span>APIs for the text
+  <h4 id=textFieldSelection><span class=secno>5.5.2 </span>APIs for the text
    field selections</h4>
 
   <p class=big-issue>When we define HTMLTextAreaElement and HTMLInputElement
@@ -35727,6 +35543,190 @@
    elements that are not displaying simple text fields, they must raise an
    <code>INVALID_STATE_ERR</code> exception.
 
+  <h3 id=command><span class=secno>5.6 </span>Command APIs</h3>
+
+  <p>The <dfn id=execCommand
+   title=dom-document-execCommand><code>execCommand(<var
+   title="">commandId</var>, <var title="">doShowUI</var>, <var
+   title="">value</var>)</code></dfn> method on the <code><a
+   href="#htmldocument">HTMLDocument</a></code> interface allows scripts to
+   perform actions on the <a href="#a-selection" title="the
+   selection">current selection</a> or at the current caret position.
+   Generally, these commands would be used to implement editor UI, for
+   example having a "delete" button on a toolbar.
+
+  <p>There are three variants to this method, with one, two, and three
+   arguments respectively. The <var title="">doShowUI</var> and <var
+   title="">value</var> parameters, even if specified, are ignored unless
+   otherwise stated.
+
+  <p class=note>In this specification, in fact, the <var
+   title="">doShowUI</var> parameter is always ignored, regardless of its
+   value. It is included for historical reasons only.
+
+  <p>When any of these methods are invoked, user agents must act as described
+   in the list below.
+
+  <p>For actions marked "<dfn id=editing2>editing hosts only</dfn>", if the
+   selection is not entirely within an <a href="#editing1">editing host</a>,
+   of if there is no selection and the caret is not inside an <a
+   href="#editing1">editing host</a>, then the user agent must do nothing.
+
+  <dl>
+   <dt>If the <var title="">commandId</var> is <dfn id=undo1
+    title=command-undo><code>undo</code></dfn>
+
+   <dd>The user agent must <a href="#undo-moving0" title=do-undo>move back
+    one step</a> in its <a href="#undo-transaction">undo transaction
+    history</a>, restoring the associated state. If there is no further undo
+    information the user agent must do nothing. See the <a
+    href="#undo-history">undo history</a>.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=redo0
+    title=command-redo><code>redo</code></dfn>
+
+   <dd>The user agent must <a href="#redo-moving0" title=do-redo>move forward
+    one step</a> in its <a href="#undo-transaction">undo transaction
+    history</a>, restoring the associated state. If there is no further undo
+    (well, "redo") information the user agent must do nothing. See the <a
+    href="#undo-history">undo history</a>.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=selectall0
+    title=command-selectAll><code>selectAll</code></dfn>
+
+   <dd>The user agent must change the selection so that all the content in
+    the currently focused <a href="#editing1">editing host</a> is selected.
+    If no <a href="#editing1">editing host</a> is focused, then the content
+    of the entire document must be selected.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=unselect
+    title=command-unselect><code>unselect</code></dfn>
+
+   <dd>
+    <p>The user agent must change the selection so that nothing is selected.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=superscript
+    title=command-superscript><code>superscript</code></dfn>
+
+   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
+    must act as if the user had requested that the selection <a
+    href="#contenteditable-wrapSemantic">be wrapped in the semantics</a> of
+    the <code><a href="#sup">sup</a></code> element (or unwrapped, or, if
+    there is no selection, have that semantic inserted or removed — the
+    exact behaviour is UA-defined).
+
+   <dt>If the <var title="">commandId</var> is <dfn id=subscript
+    title=command-subscript><code>subscript</code></dfn>
+
+   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
+    must act as if the user had requested that the selection <a
+    href="#contenteditable-wrapSemantic">be wrapped in the semantics</a> of
+    the <em title=""><code><a href="#sub">sub</a></code></em> element (or,
+    again, unwrapped, or have that semantic inserted or removed, as defined
+    by the UA).
+
+   <dt>If the <var title="">commandId</var> is <dfn id=formatblock
+    title=command-formatBlock><code>formatBlock</code></dfn>
+
+   <dd>
+    <p><em><a href="#editing2">Editing hosts only.</a></em> This command
+     changes the semantics of the blocks containing the selection.</p>
+
+    <p>If there is no selection, then, where in the description below refers
+     to the selection, the user agent must act as if the selection was an
+     empty range at the caret position.</p>
+
+    <p>If the <var title="">value</var> parameter is not specified or has a
+     value other than one of the following literal strings:</p>
+
+    <ul class=brief>
+     <li><code title=""><address></code>
+
+     <li><code title=""><aside></code>
+
+     <li><code title=""><h1></code>
+
+     <li><code title=""><h2></code>
+
+     <li><code title=""><h3></code>
+
+     <li><code title=""><h4></code>
+
+     <li><code title=""><h5></code>
+
+     <li><code title=""><h6></code>
+
+     <li><code title=""><nav></code>
+
+     <li><code title=""><p></code>
+
+     <li><code title=""><pre></code></li>
+     <!-- XXX this list is incomplete -->
+    </ul>
+
+    <p>...then the user agent must do nothing.</p>
+
+    <p>Otherwise, the user agent must, for every position in the selection,
+     take the furthest <a href="#flow-content0">flow content</a> ancestor
+     element of that position that contains only <a
+     href="#phrasing0">phrasing content</a>, and, if that element is a
+     descendant of the editing host, rename it (as if the <code
+     title="">Element.renameNode()</code> method had been used) according to
+     the <var title="">value</var>, by stripping the leading
+     <code><</code> character and the trailing <code>></code> character
+     and using the rest as the new tag name, using the HTML namespace.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=delete
+    title=command-delete><code>delete</code></dfn>
+
+   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
+    must act as if the user had performed <a href="#contenteditable-delete">a
+    backspace operation</a>.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=forwarddelete
+    title=command-forwardDelete><code>forwardDelete</code></dfn>
+
+   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
+    must act as if the user had performed <a href="#contenteditable-delete">a
+    forward delete operation</a>.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=insertlinebreak
+    title=command-insertLineBreak><code>insertLineBreak</code></dfn>
+
+   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
+    must act as if the user had <a href="#contenteditable-br">requested a
+    line separator</a>.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=insertparagraph
+    title=command-insertParagraph><code>insertParagraph</code></dfn>
+
+   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
+    must act as if the user had performed a <a
+    href="#contenteditable-breakBlock">break block</a> editing action.
+
+   <dt>If the <var title="">commandId</var> is <dfn id=inserttext
+    title=command-insertText><code>insertText</code></dfn>
+
+   <dd><em><a href="#editing2">Editing hosts only.</a></em> The user agent
+    must act as if the user had <a
+    href="#contenteditable-insertText">inserted text</a> corresponding to the
+    <var title="">value</var> parameter.
+
+   <dt>If the <var title="">commandId</var> is <code><var
+    title="">vendorID</var>-<var title="">customCommandID</var></code>
+
+   <dd>User agents may implement vendor-specific extensions to this API.
+    Vendor-specific extensions to the list of commands should use the syntax
+    <code><var title="">vendorID</var>-<var
+    title="">customCommandID</var></code> so as to prevent clashes between
+    extensions from different vendors and future additions to this
+    specification.
+
+   <dt>If the <var title="">commandId</var> is something else
+
+   <dd>User agents must do nothing.
+  </dl>
+
   <h2 id=comms><span class=secno>6. </span>Communication</h2>
 
   <h3 id=event1><span class=secno>6.1 </span>Event definitions</h3>

Modified: source
===================================================================
--- source	2008-03-07 02:19:32 UTC (rev 1353)
+++ source	2008-03-07 02:21:25 UTC (rev 1354)
@@ -32624,166 +32624,9 @@
   no detectable difference.</p>
 
 
-  <h3>Command APIs</h3>
 
-  <p>The <dfn id="execCommand"
-  title="dom-document-execCommand"><code>execCommand(<var
-  title="">commandId</var>, <var title="">doShowUI</var>, <var
-  title="">value</var>)</code></dfn> method on the
-  <code>HTMLDocument</code> interface allows scripts to perform
-  actions on the <span title="the selection">current selection</span>
-  or at the current caret position. Generally, these commands would be
-  used to implement editor UI, for example having a "delete" button on
-  a toolbar.</p>
 
-  <p>There are three variants to this method, with one, two, and three
-  arguments respectively.  The <var title="">doShowUI</var> and <var
-  title="">value</var> parameters, even if specified, are ignored
-  unless otherwise stated.</p>
 
-  <p class="note">In this specification, in fact, the <var
-  title="">doShowUI</var> parameter is always ignored, regardless of
-  its value. It is included for historical reasons only.</p>
-
-  <p>When any of these methods are invoked, user agents must act as
-  described in the list below.</p>
-
-  <p>For actions marked "<dfn>editing hosts only</dfn>", if the
-  selection is not entirely within an <span>editing host</span>, of if
-  there is no selection and the caret is not inside an <span>editing
-  host</span>, then the user agent must do nothing.</p>
-
-  <dl>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-undo"><code>undo</code></dfn></dt>
-
-   <dd>The user agent must <span title="do-undo">move back one
-   step</span> in its <span>undo transaction history</span>, restoring
-   the associated state. If there is no further undo information the
-   user agent must do nothing. See the <span>undo history</span>.</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-redo"><code>redo</code></dfn></dt>
-
-   <dd>The user agent must <span title="do-redo">move forward one
-   step</span> in its <span>undo transaction history</span>, restoring
-   the associated state. If there is no further undo (well, "redo")
-   information the user agent must do nothing. See the <span>undo
-   history</span>.</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-selectAll"><code>selectAll</code></dfn></dt>
-
-   <dd>The user agent must change the selection so that all the
-   content in the currently focused <span>editing host</span> is
-   selected. If no <span>editing host</span> is focused, then the
-   content of the entire document must be selected.</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-unselect"><code>unselect</code></dfn></dt>
-
-   <dd><p>The user agent must change the selection so that nothing is
-   selected.</p></dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-superscript"><code>superscript</code></dfn></dt>
-
-   <dd><em>Editing hosts only.</em> The user agent must act as if the
-   user had requested that the selection <a
-   href="#contenteditable-wrapSemantic">be wrapped in the
-   semantics</a> of the <code>sup</code> element (or unwrapped, or, if
-   there is no selection, have that semantic inserted or removed
-   — the exact behaviour is UA-defined).</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-subscript"><code>subscript</code></dfn></dt>
-
-   <dd><em>Editing hosts only.</em> The user agent must act as if the
-   user had requested that the selection <a
-   href="#contenteditable-wrapSemantic">be wrapped in the
-   semantics</a> of the <em title=""><code>sub</code></em> element (or, again,
-   unwrapped, or have that semantic inserted or removed, as defined by
-   the UA).</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-formatBlock"><code>formatBlock</code></dfn></dt>
-
-   <dd><p><em>Editing hosts only.</em> This command changes the
-   semantics of the blocks containing the selection.</p>
-
-   <p>If there is no selection, then, where in the description below
-   refers to the selection, the user agent must act as if the
-   selection was an empty range at the caret position.</p>
-
-   <p>If the <var title="">value</var> parameter is not specified or
-   has a value other than one of the following literal strings:</p>
-   <ul class="brief">
-    <li><code title=""><address></code></li>
-    <li><code title=""><aside></code></li>
-    <li><code title=""><h1></code></li>
-    <li><code title=""><h2></code></li>
-    <li><code title=""><h3></code></li>
-    <li><code title=""><h4></code></li>
-    <li><code title=""><h5></code></li>
-    <li><code title=""><h6></code></li>
-    <li><code title=""><nav></code></li>
-    <li><code title=""><p></code></li>
-    <li><code title=""><pre></code></li>
-    <!-- XXX this list is incomplete -->
-   </ul>
-   <p>...then the user agent must do nothing.</p>
-
-   <p>Otherwise, the user agent must, for every position in the
-   selection, take the furthest <span>flow content</span> ancestor
-   element of that position that contains only <span>phrasing
-   content</span>, and, if that element is a descendant of the editing
-   host, rename it (as if the <code
-   title="">Element.renameNode()</code> method had been used)
-   according to the <var title="">value</var>, by stripping the
-   leading <code><</code> character and the trailing
-   <code>></code> character and using the rest as the new tag name,
-   using the HTML namespace.</p></dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-delete"><code>delete</code></dfn></dt>
-
-   <dd><em>Editing hosts only.</em> The user agent must act as if the
-   user had performed <a href="#contenteditable-delete">a backspace
-   operation</a>.</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-forwardDelete"><code>forwardDelete</code></dfn></dt>
-
-   <dd><em>Editing hosts only.</em> The user agent must act as if the
-   user had performed <a href="#contenteditable-delete">a forward
-   delete operation</a>.</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-insertLineBreak"><code>insertLineBreak</code></dfn></dt>
-
-   <dd><em>Editing hosts only.</em> The user agent must act as if the
-   user had <a href="#contenteditable-br">requested a line
-   separator</a>.</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-insertParagraph"><code>insertParagraph</code></dfn></dt>
-
-   <dd><em>Editing hosts only.</em> The user agent must act as if the
-   user had performed a <a href="#contenteditable-breakBlock">break
-   block</a> editing action.</dd>
-
-   <dt>If the <var title="">commandId</var> is <dfn title="command-insertText"><code>insertText</code></dfn></dt>
-
-   <dd><em>Editing hosts only.</em> The user agent must act as if the
-   user had <a href="#contenteditable-insertText">inserted text</a>
-   corresponding to the <var title="">value</var> parameter.</dd>
-
-   <dt>If the <var title="">commandId</var> is <code><var title="">vendorID</var>-<var title="">customCommandID</var></code></dt>
-
-   <dd>User agents may implement vendor-specific extensions to this
-   API. Vendor-specific extensions to the list of commands should use
-   the syntax <code><var title="">vendorID</var>-<var
-   title="">customCommandID</var></code> so as to prevent clashes
-   between extensions from different vendors and future additions to
-   this specification.</dd>
-
-   <dt>If the <var title="">commandId</var> is something else</dt>
-
-   <dd>User agents must do nothing.</dd>
-
-  </dl>
-
-
   <h3 id="selection">The text selection APIs</h3>
 
   <p>Every <span>browsing context</span> has <dfn title="the
@@ -33143,6 +32986,171 @@
   exception.</p>
 
 
+
+  <h3>Command APIs</h3>
+
+  <p>The <dfn id="execCommand"
+  title="dom-document-execCommand"><code>execCommand(<var
+  title="">commandId</var>, <var title="">doShowUI</var>, <var
+  title="">value</var>)</code></dfn> method on the
+  <code>HTMLDocument</code> interface allows scripts to perform
+  actions on the <span title="the selection">current selection</span>
+  or at the current caret position. Generally, these commands would be
+  used to implement editor UI, for example having a "delete" button on
+  a toolbar.</p>
+
+  <p>There are three variants to this method, with one, two, and three
+  arguments respectively.  The <var title="">doShowUI</var> and <var
+  title="">value</var> parameters, even if specified, are ignored
+  unless otherwise stated.</p>
+
+  <p class="note">In this specification, in fact, the <var
+  title="">doShowUI</var> parameter is always ignored, regardless of
+  its value. It is included for historical reasons only.</p>
+
+  <p>When any of these methods are invoked, user agents must act as
+  described in the list below.</p>
+
+  <p>For actions marked "<dfn>editing hosts only</dfn>", if the
+  selection is not entirely within an <span>editing host</span>, of if
+  there is no selection and the caret is not inside an <span>editing
+  host</span>, then the user agent must do nothing.</p>
+
+  <dl>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-undo"><code>undo</code></dfn></dt>
+
+   <dd>The user agent must <span title="do-undo">move back one
+   step</span> in its <span>undo transaction history</span>, restoring
+   the associated state. If there is no further undo information the
+   user agent must do nothing. See the <span>undo history</span>.</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-redo"><code>redo</code></dfn></dt>
+
+   <dd>The user agent must <span title="do-redo">move forward one
+   step</span> in its <span>undo transaction history</span>, restoring
+   the associated state. If there is no further undo (well, "redo")
+   information the user agent must do nothing. See the <span>undo
+   history</span>.</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-selectAll"><code>selectAll</code></dfn></dt>
+
+   <dd>The user agent must change the selection so that all the
+   content in the currently focused <span>editing host</span> is
+   selected. If no <span>editing host</span> is focused, then the
+   content of the entire document must be selected.</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-unselect"><code>unselect</code></dfn></dt>
+
+   <dd><p>The user agent must change the selection so that nothing is
+   selected.</p></dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-superscript"><code>superscript</code></dfn></dt>
+
+   <dd><em>Editing hosts only.</em> The user agent must act as if the
+   user had requested that the selection <a
+   href="#contenteditable-wrapSemantic">be wrapped in the
+   semantics</a> of the <code>sup</code> element (or unwrapped, or, if
+   there is no selection, have that semantic inserted or removed
+   — the exact behaviour is UA-defined).</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-subscript"><code>subscript</code></dfn></dt>
+
+   <dd><em>Editing hosts only.</em> The user agent must act as if the
+   user had requested that the selection <a
+   href="#contenteditable-wrapSemantic">be wrapped in the
+   semantics</a> of the <em title=""><code>sub</code></em> element (or, again,
+   unwrapped, or have that semantic inserted or removed, as defined by
+   the UA).</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-formatBlock"><code>formatBlock</code></dfn></dt>
+
+   <dd><p><em>Editing hosts only.</em> This command changes the
+   semantics of the blocks containing the selection.</p>
+
+   <p>If there is no selection, then, where in the description below
+   refers to the selection, the user agent must act as if the
+   selection was an empty range at the caret position.</p>
+
+   <p>If the <var title="">value</var> parameter is not specified or
+   has a value other than one of the following literal strings:</p>
+   <ul class="brief">
+    <li><code title=""><address></code></li>
+    <li><code title=""><aside></code></li>
+    <li><code title=""><h1></code></li>
+    <li><code title=""><h2></code></li>
+    <li><code title=""><h3></code></li>
+    <li><code title=""><h4></code></li>
+    <li><code title=""><h5></code></li>
+    <li><code title=""><h6></code></li>
+    <li><code title=""><nav></code></li>
+    <li><code title=""><p></code></li>
+    <li><code title=""><pre></code></li>
+    <!-- XXX this list is incomplete -->
+   </ul>
+   <p>...then the user agent must do nothing.</p>
+
+   <p>Otherwise, the user agent must, for every position in the
+   selection, take the furthest <span>flow content</span> ancestor
+   element of that position that contains only <span>phrasing
+   content</span>, and, if that element is a descendant of the editing
+   host, rename it (as if the <code
+   title="">Element.renameNode()</code> method had been used)
+   according to the <var title="">value</var>, by stripping the
+   leading <code><</code> character and the trailing
+   <code>></code> character and using the rest as the new tag name,
+   using the HTML namespace.</p></dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-delete"><code>delete</code></dfn></dt>
+
+   <dd><em>Editing hosts only.</em> The user agent must act as if the
+   user had performed <a href="#contenteditable-delete">a backspace
+   operation</a>.</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-forwardDelete"><code>forwardDelete</code></dfn></dt>
+
+   <dd><em>Editing hosts only.</em> The user agent must act as if the
+   user had performed <a href="#contenteditable-delete">a forward
+   delete operation</a>.</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-insertLineBreak"><code>insertLineBreak</code></dfn></dt>
+
+   <dd><em>Editing hosts only.</em> The user agent must act as if the
+   user had <a href="#contenteditable-br">requested a line
+   separator</a>.</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-insertParagraph"><code>insertParagraph</code></dfn></dt>
+
+   <dd><em>Editing hosts only.</em> The user agent must act as if the
+   user had performed a <a href="#contenteditable-breakBlock">break
+   block</a> editing action.</dd>
+
+   <dt>If the <var title="">commandId</var> is <dfn title="command-insertText"><code>insertText</code></dfn></dt>
+
+   <dd><em>Editing hosts only.</em> The user agent must act as if the
+   user had <a href="#contenteditable-insertText">inserted text</a>
+   corresponding to the <var title="">value</var> parameter.</dd>
+
+   <dt>If the <var title="">commandId</var> is <code><var title="">vendorID</var>-<var title="">customCommandID</var></code></dt>
+
+   <dd>User agents may implement vendor-specific extensions to this
+   API. Vendor-specific extensions to the list of commands should use
+   the syntax <code><var title="">vendorID</var>-<var
+   title="">customCommandID</var></code> so as to prevent clashes
+   between extensions from different vendors and future additions to
+   this specification.</dd>
+
+   <dt>If the <var title="">commandId</var> is something else</dt>
+
+   <dd>User agents must do nothing.</dd>
+
+  </dl>
+
+
+
+
+
+
   <h2 id="comms">Communication</h2>
 
 




More information about the Commit-Watchers mailing list