Move a section
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Mon, 30 May 2011 13:08:18 -0600
changeset 195 cd1e5bb29995
parent 194 ced7013650e9
child 196 1b080ed11898
Move a section
editcommands.html
source.html
--- a/editcommands.html	Mon May 30 12:44:32 2011 -0600
+++ b/editcommands.html	Mon May 30 13:08:18 2011 -0600
@@ -65,9 +65,9 @@
  <li><a class=no-num href=#table-of-contents>Table of contents</a></li>
  <li><a href=#introduction><span class=secno>1 </span>Introduction</a></li>
  <li><a href=#issues><span class=secno>2 </span>Issues</a></li>
- <li><a href=#common-definitions><span class=secno>3 </span>Common definitions</a></li>
- <li><a href=#common-algorithms><span class=secno>4 </span>Common algorithms</a></li>
- <li><a href=#methods-of-the-htmldocument-interface><span class=secno>5 </span>Methods of the <code class=external data-anolis-spec=html>HTMLDocument</code> interface</a></li>
+ <li><a href=#methods-of-the-htmldocument-interface><span class=secno>3 </span>Methods of the <code class=external data-anolis-spec=html>HTMLDocument</code> interface</a></li>
+ <li><a href=#common-definitions><span class=secno>4 </span>Common definitions</a></li>
+ <li><a href=#common-algorithms><span class=secno>5 </span>Common algorithms</a></li>
  <li><a href=#inline-formatting-commands><span class=secno>6 </span>Inline formatting commands</a>
   <ol>
    <li><a href=#inline-formatting-command-definitions><span class=secno>6.1 </span>Inline formatting command definitions</a></li>
@@ -262,7 +262,74 @@
 like this.
 
 
-<h2 id=common-definitions><span class=secno>3 </span>Common definitions</h2>
+<h2 id=methods-of-the-htmldocument-interface><span class=secno>3 </span>Methods of the <code class=external data-anolis-spec=html><a href=http://www.whatwg.org/html/#htmldocument>HTMLDocument</a></code> interface</h2>
+
+<p>The <dfn id=execcommand() title=execCommand()><code>execCommand(<var title="">command</var>,
+<var title="">showUI</var>, <var title="">value</var>)</code></dfn> method on the
+<code class=external data-anolis-spec=html><a href=http://www.whatwg.org/html/#htmldocument>HTMLDocument</a></code> interface allows scripts to
+perform actions on the current selection 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.  There are three variants to this
+method, with one, two, and three arguments respectively. The <var title="">showUI</var>
+and <var title="">value</var> parameters, even if specified, are ignored except where
+otherwise stated.
+
+<p>The <dfn id=querycommandstate() title=queryCommandState()><code>queryCommandState(<var title="">command</var>)</code></dfn>
+method on the <code class=external data-anolis-spec=html><a href=http://www.whatwg.org/html/#htmldocument>HTMLDocument</a></code> interface allows
+scripts to ask true-or-false status questions about the current selection, such
+as whether it is bold or not.
+
+<p>The <dfn id=querycommandvalue() title=queryCommandValue()><code>queryCommandValue(<var title="">command</var>)</code></dfn>
+method on the <code class=external data-anolis-spec=html><a href=http://www.whatwg.org/html/#htmldocument>HTMLDocument</a></code> interface allows
+scripts to get the value of some property of the current selection in string
+form, such as what color it is.
+
+<p>All three of these methods operate using particular <dfn id=command title=command>commands</dfn>, identified by a string <var title="">command</var> passed
+as the first argument.  The <var title="">command</var> argument of all three methods
+must be treated in an <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive>ASCII
+case-insensitive</a> manner.  Each <a href=#command>command</a> is defined in its
+own section of this specification.
+
+<p><a href=#command title=command>Commands</a> may have an associated
+<dfn id=action>action</dfn>, <dfn id=state>state</dfn>, <dfn id=value>value</dfn>, and/or <dfn id=relevant-css-property>relevant
+CSS property</dfn>.  If not otherwise specified, the <a href=#action>action</a> for a
+command is to do nothing, the <a href=#state>state</a> is false, the
+<a href=#value>value</a> is the empty string, and the <a href=#relevant-css-property>relevant CSS
+property</a> is null.
+<!-- Requesting the state of an unknown command throws an exception in IE 9 RC
+and Firefox 4b11, and returns boolean false in Chrome 10 and Opera 11.
+
+Requesting the value of an unknown command throws an exception in IE 9 RC and
+in Firefox 4b11.  It returns boolean false in Chrome 10, and the empty string
+in Opera 11. -->
+
+<p>When <code><a href=#execcommand()>execCommand()</a></code> is invoked, the user agent must follow the
+<a href=#action>action</a> instructions given in this specification for
+<var title="">command</var>, with <var title="">showUI</var> and <var title="">value</var> passed to the
+instructions as arguments.  When <code><a href=#querycommandstate()>queryCommandState()</a></code> is invoked,
+the user agent must return the <a href=#state>state</a> for <var title="">command</var>.  When
+<code><a href=#querycommandvalue()>queryCommandValue()</a></code> is invoked, the user agent must return the
+<a href=#value>value</a> for <var title="">command</var>.
+
+<p>Most <a href=#command title=command>commands</a> act on the <dfn id=active-range>active range</dfn>.
+This is defined to be the first <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range title=concept-range>range</a> in the <code class=external data-anolis-spec=domrange><a href=http://html5.org/specs/dom-range.html#selection>Selection</a></code> given by calling
+<code class=external data-anolis-spec=domrange title=dom-Document-getSelection><a href=http://html5.org/specs/dom-range.html#dom-document-getselection>getSelection()</a></code> on the <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#context-object>context object</a>, or null if there is no such
+<a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range title=concept-range>range</a>.  If the <a href=#active-range>active range</a> is null, all <a href=#command title=command>commands</a> must behave as though they were not defined
+except <a href=#the-stylewithcss-command>the <code title="">styleWithCSS</code> command</a> and <a href=#the-usecss-command>the
+<code title="">useCSS</code> command</a>.
+
+<p class=XXX>Querying the value or state of an unrecognized command throws an
+exception in IE and Firefox.  Need to consider changing to that behavior.
+
+<p class=XXX>I say "first range" because I think that's what Gecko actually
+does, and Gecko is the only one that allows multiple ranges in a selection.
+This is keeping in mind that it stores ranges sorted by start, not by the order
+the user added them, and silently removes or shortens existing ranges to avoid
+overlap.  It probably makes the most sense in the long term to have the command
+affect all ranges.  But I'll leave this for later.
+
+
+<h2 id=common-definitions><span class=secno>4 </span>Common definitions</h2>
 
 <p>An <dfn id=html-element>HTML element</dfn> is an <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element>Element</a></code> whose <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-element-namespace title=concept-element-namespace>namespace</a> is the
 <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#html-namespace>HTML namespace</a>.
@@ -503,7 +570,7 @@
 sequentially in the list's order.
 
 
-<h2 id=common-algorithms><span class=secno>4 </span>Common algorithms</h2>
+<h2 id=common-algorithms><span class=secno>5 </span>Common algorithms</h2>
 
 <p>To <dfn id=set-the-tag-name>set the tag name</dfn> of an <code class=external data-anolis-spec=domcore><a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element>Element</a></code> <var title="">element</var> to
 <var title="">new name</var>:
@@ -1009,72 +1076,6 @@
 </ol>
 
 
-<h2 id=methods-of-the-htmldocument-interface><span class=secno>5 </span>Methods of the <code class=external data-anolis-spec=html><a href=http://www.whatwg.org/html/#htmldocument>HTMLDocument</a></code> interface</h2>
-
-<p>The <dfn id=execcommand() title=execCommand()><code>execCommand(<var title="">command</var>,
-<var title="">showUI</var>, <var title="">value</var>)</code></dfn> method on the
-<code class=external data-anolis-spec=html><a href=http://www.whatwg.org/html/#htmldocument>HTMLDocument</a></code> interface allows scripts to
-perform actions on the current selection 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.  There are three variants to this
-method, with one, two, and three arguments respectively. The <var title="">showUI</var>
-and <var title="">value</var> parameters, even if specified, are ignored except where
-otherwise stated.
-
-<p>The <dfn id=querycommandstate() title=queryCommandState()><code>queryCommandState(<var title="">command</var>)</code></dfn>
-method on the <code class=external data-anolis-spec=html><a href=http://www.whatwg.org/html/#htmldocument>HTMLDocument</a></code> interface allows
-scripts to ask true-or-false status questions about the current selection, such
-as whether it is bold or not.
-
-<p>The <dfn id=querycommandvalue() title=queryCommandValue()><code>queryCommandValue(<var title="">command</var>)</code></dfn>
-method on the <code class=external data-anolis-spec=html><a href=http://www.whatwg.org/html/#htmldocument>HTMLDocument</a></code> interface allows
-scripts to get the value of some property of the current selection in string
-form, such as what color it is.
-
-<p>All three of these methods operate using particular <dfn id=command title=command>commands</dfn>, identified by a string <var title="">command</var> passed
-as the first argument.  The <var title="">command</var> argument of all three methods
-must be treated in an <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive>ASCII
-case-insensitive</a> manner.  Each <a href=#command>command</a> is defined in its
-own section of this specification.
-
-<p><a href=#command title=command>Commands</a> may have an associated
-<dfn id=action>action</dfn>, <dfn id=state>state</dfn>, <dfn id=value>value</dfn>, and/or <dfn id=relevant-css-property>relevant
-CSS property</dfn>.  If not otherwise specified, the <a href=#action>action</a> for a
-command is to do nothing, the <a href=#state>state</a> is false, the
-<a href=#value>value</a> is the empty string, and the <a href=#relevant-css-property>relevant CSS
-property</a> is null.
-<!-- Requesting the state of an unknown command throws an exception in IE 9 RC
-and Firefox 4b11, and returns boolean false in Chrome 10 and Opera 11.
-
-Requesting the value of an unknown command throws an exception in IE 9 RC and
-in Firefox 4b11.  It returns boolean false in Chrome 10, and the empty string
-in Opera 11. -->
-
-<p>When <code><a href=#execcommand()>execCommand()</a></code> is invoked, the user agent must follow the
-<a href=#action>action</a> instructions given in this specification for
-<var title="">command</var>, with <var title="">showUI</var> and <var title="">value</var> passed to the
-instructions as arguments.  When <code><a href=#querycommandstate()>queryCommandState()</a></code> is invoked,
-the user agent must return the <a href=#state>state</a> for <var title="">command</var>.  When
-<code><a href=#querycommandvalue()>queryCommandValue()</a></code> is invoked, the user agent must return the
-<a href=#value>value</a> for <var title="">command</var>.
-
-<p>Most <a href=#command title=command>commands</a> act on the <dfn id=active-range>active range</dfn>.
-This is defined to be the first <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range title=concept-range>range</a> in the <code class=external data-anolis-spec=domrange><a href=http://html5.org/specs/dom-range.html#selection>Selection</a></code> given by calling
-<code class=external data-anolis-spec=domrange title=dom-Document-getSelection><a href=http://html5.org/specs/dom-range.html#dom-document-getselection>getSelection()</a></code> on the <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#context-object>context object</a>, or null if there is no such
-<a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range title=concept-range>range</a>.  If the <a href=#active-range>active range</a> is null, all <a href=#command title=command>commands</a> must behave as though they were not defined
-except <a href=#the-stylewithcss-command>the <code title="">styleWithCSS</code> command</a> and <a href=#the-usecss-command>the
-<code title="">useCSS</code> command</a>.
-
-<p class=XXX>Querying the value or state of an unrecognized command throws an
-exception in IE and Firefox.  Need to consider changing to that behavior.
-
-<p class=XXX>I say "first range" because I think that's what Gecko actually
-does, and Gecko is the only one that allows multiple ranges in a selection.
-This is keeping in mind that it stores ranges sorted by start, not by the order
-the user added them, and silently removes or shortens existing ranges to avoid
-overlap.  It probably makes the most sense in the long term to have the command
-affect all ranges.  But I'll leave this for later.
-
 <!--
 Things that are only implemented by a couple of browsers and may or may not be
 useful to spec:
--- a/source.html	Mon May 30 12:44:32 2011 -0600
+++ b/source.html	Mon May 30 13:08:18 2011 -0600
@@ -214,6 +214,77 @@
 like this.
 
 
+<h2>Methods of the <code data-anolis-spec=html>HTMLDocument</code> interface</h2>
+
+<p>The <dfn title=execCommand()><code>execCommand(<var>command</var>,
+<var>showUI</var>, <var>value</var>)</code></dfn> method on the
+<code data-anolis-spec=html>HTMLDocument</code> interface allows scripts to
+perform actions on the current selection 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.  There are three variants to this
+method, with one, two, and three arguments respectively. The <var>showUI</var>
+and <var>value</var> parameters, even if specified, are ignored except where
+otherwise stated.
+
+<p>The <dfn
+title=queryCommandState()><code>queryCommandState(<var>command</var>)</code></dfn>
+method on the <code data-anolis-spec=html>HTMLDocument</code> interface allows
+scripts to ask true-or-false status questions about the current selection, such
+as whether it is bold or not.
+
+<p>The <dfn
+title=queryCommandValue()><code>queryCommandValue(<var>command</var>)</code></dfn>
+method on the <code data-anolis-spec=html>HTMLDocument</code> interface allows
+scripts to get the value of some property of the current selection in string
+form, such as what color it is.
+
+<p>All three of these methods operate using particular <dfn
+title=command>commands</dfn>, identified by a string <var>command</var> passed
+as the first argument.  The <var>command</var> argument of all three methods
+must be treated in an <span data-anolis-spec=domcore>ASCII
+case-insensitive</span> manner.  Each <span>command</span> is defined in its
+own section of this specification.
+
+<p><span title=command>Commands</span> may have an associated
+<dfn>action</dfn>, <dfn>state</dfn>, <dfn>value</dfn>, and/or <dfn>relevant
+CSS property</dfn>.  If not otherwise specified, the <span>action</span> for a
+command is to do nothing, the <span>state</span> is false, the
+<span>value</span> is the empty string, and the <span>relevant CSS
+property</span> is null.
+<!-- Requesting the state of an unknown command throws an exception in IE 9 RC
+and Firefox 4b11, and returns boolean false in Chrome 10 and Opera 11.
+
+Requesting the value of an unknown command throws an exception in IE 9 RC and
+in Firefox 4b11.  It returns boolean false in Chrome 10, and the empty string
+in Opera 11. -->
+
+<p>When <code>execCommand()</code> is invoked, the user agent must follow the
+<span>action</span> instructions given in this specification for
+<var>command</var>, with <var>showUI</var> and <var>value</var> passed to the
+instructions as arguments.  When <code>queryCommandState()</code> is invoked,
+the user agent must return the <span>state</span> for <var>command</var>.  When
+<code>queryCommandValue()</code> is invoked, the user agent must return the
+<span>value</span> for <var>command</var>.
+
+<p>Most <span title=command>commands</span> act on the <dfn>active range</dfn>.
+This is defined to be the first [[range]] in the [[selection]] given by calling
+[[getselection]] on the [[contextobject]], or null if there is no such
+[[range]].  If the <span>active range</span> is null, all <span
+title=command>commands</span> must behave as though they were not defined
+except <span>the <code title>styleWithCSS</code> command</span> and <span>the
+<code title>useCSS</code> command</span>.
+
+<p class=XXX>Querying the value or state of an unrecognized command throws an
+exception in IE and Firefox.  Need to consider changing to that behavior.
+
+<p class=XXX>I say "first range" because I think that's what Gecko actually
+does, and Gecko is the only one that allows multiple ranges in a selection.
+This is keeping in mind that it stores ranges sorted by start, not by the order
+the user added them, and silently removes or shortens existing ranges to avoid
+overlap.  It probably makes the most sense in the long term to have the command
+affect all ranges.  But I'll leave this for later.
+
+
 <h2>Common definitions</h2>
 
 <p>An <dfn>HTML element</dfn> is an [[element]] whose [[namespace]] is the
@@ -976,76 +1047,6 @@
 </ol>
 
 
-<h2>Methods of the <code data-anolis-spec=html>HTMLDocument</code> interface</h2>
-
-<p>The <dfn title=execCommand()><code>execCommand(<var>command</var>,
-<var>showUI</var>, <var>value</var>)</code></dfn> method on the
-<code data-anolis-spec=html>HTMLDocument</code> interface allows scripts to
-perform actions on the current selection 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.  There are three variants to this
-method, with one, two, and three arguments respectively. The <var>showUI</var>
-and <var>value</var> parameters, even if specified, are ignored except where
-otherwise stated.
-
-<p>The <dfn
-title=queryCommandState()><code>queryCommandState(<var>command</var>)</code></dfn>
-method on the <code data-anolis-spec=html>HTMLDocument</code> interface allows
-scripts to ask true-or-false status questions about the current selection, such
-as whether it is bold or not.
-
-<p>The <dfn
-title=queryCommandValue()><code>queryCommandValue(<var>command</var>)</code></dfn>
-method on the <code data-anolis-spec=html>HTMLDocument</code> interface allows
-scripts to get the value of some property of the current selection in string
-form, such as what color it is.
-
-<p>All three of these methods operate using particular <dfn
-title=command>commands</dfn>, identified by a string <var>command</var> passed
-as the first argument.  The <var>command</var> argument of all three methods
-must be treated in an <span data-anolis-spec=domcore>ASCII
-case-insensitive</span> manner.  Each <span>command</span> is defined in its
-own section of this specification.
-
-<p><span title=command>Commands</span> may have an associated
-<dfn>action</dfn>, <dfn>state</dfn>, <dfn>value</dfn>, and/or <dfn>relevant
-CSS property</dfn>.  If not otherwise specified, the <span>action</span> for a
-command is to do nothing, the <span>state</span> is false, the
-<span>value</span> is the empty string, and the <span>relevant CSS
-property</span> is null.
-<!-- Requesting the state of an unknown command throws an exception in IE 9 RC
-and Firefox 4b11, and returns boolean false in Chrome 10 and Opera 11.
-
-Requesting the value of an unknown command throws an exception in IE 9 RC and
-in Firefox 4b11.  It returns boolean false in Chrome 10, and the empty string
-in Opera 11. -->
-
-<p>When <code>execCommand()</code> is invoked, the user agent must follow the
-<span>action</span> instructions given in this specification for
-<var>command</var>, with <var>showUI</var> and <var>value</var> passed to the
-instructions as arguments.  When <code>queryCommandState()</code> is invoked,
-the user agent must return the <span>state</span> for <var>command</var>.  When
-<code>queryCommandValue()</code> is invoked, the user agent must return the
-<span>value</span> for <var>command</var>.
-
-<p>Most <span title=command>commands</span> act on the <dfn>active range</dfn>.
-This is defined to be the first [[range]] in the [[selection]] given by calling
-[[getselection]] on the [[contextobject]], or null if there is no such
-[[range]].  If the <span>active range</span> is null, all <span
-title=command>commands</span> must behave as though they were not defined
-except <span>the <code title>styleWithCSS</code> command</span> and <span>the
-<code title>useCSS</code> command</span>.
-
-<p class=XXX>Querying the value or state of an unrecognized command throws an
-exception in IE and Firefox.  Need to consider changing to that behavior.
-
-<p class=XXX>I say "first range" because I think that's what Gecko actually
-does, and Gecko is the only one that allows multiple ranges in a selection.
-This is keeping in mind that it stores ranges sorted by start, not by the order
-the user added them, and silently removes or shortens existing ranges to avoid
-overlap.  It probably makes the most sense in the long term to have the command
-affect all ranges.  But I'll leave this for later.
-
 <!--
 Things that are only implemented by a couple of browsers and may or may not be
 useful to spec: