Collapse things more compactly
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Wed, 13 Jul 2011 11:19:57 -0600
changeset 416 b6d2a795adbe
parent 415 2af939d46179
child 417 9e929c7fbda7
Collapse things more compactly

If you aren't viewing in vim, you won't notice the difference. Yeah, I
know, I said I would spend less time refactoring and more time doing
actual work, but I've hardly refactored in the last few days. And this
was pretty quick. Also, it will make me have to scroll less, which
improves my efficiency. So there.
editcommands.html
implementation.js
source.html
--- a/editcommands.html	Wed Jul 13 11:10:27 2011 -0600
+++ b/editcommands.html	Wed Jul 13 11:19:57 2011 -0600
@@ -143,36 +143,6 @@
  <li><a class=no-num href=#acknowledgements>Acknowledgements</a></ol>
 <!--end-toc-->
 
-<!--
-Things that are only implemented by a couple of browsers and may or may not be
-useful to spec:
-
-* decreaseFontSize, increaseFontSize: Only implemented in Gecko and Opera.
-* contentReadOnly, enableInlineTableEditing, enableObjectResizing, heading,
-  insertBrOnReturn: MDC docs say not implemented in IE (didn't test).
-* readOnly: MDC docs say it's a deprecated equivalent of contentReadOnly, so
-  presumably like useCSS but less popular.
-* 2D-Position, absolutePosition, clearAuthenticationCache, createBookmark,
-  insertButton, insertFieldset, insertIframe, insertInput*, insertMarquee,
-  insertSelectDropdown, insertSelectListbox, insertTextarea, liveResize,
-  multipleSelection, overwrite, print, refresh, saveAs, unbookmark: Mentioned
-  in MSDN docs but not MDC, so presumably IE-only.  Some of these seem
-  inappropriate or useless, others will bear investigation.
-* findString, fontSizeDelta, insertNewlineInQuotedContent, justifyNone, print,
-  transpose: There's code for these in WebKit,
-  Source/WebCore/editing/EditorCommand.cpp, but I didn't see them mentioned
-  elsewhere.  Some might be worth adding.
-* unselect: Seems to not be implemented by Gecko or Opera, and IE behaves
-  oddly: it seems to collapse the selection instead of removing it.  Will only
-  implement if there seems to be demand; it's redundant to
-  Selection.removeAllRanges() anyway.
-
-Things I haven't looked at that multiple browsers implement:
-
-* redo, undo: Needs review of the Google work on this; will probably be
-  quite complicated.
--->
-
 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
 
 <p>This specification defines commands to edit HTML documents programmatically.
@@ -350,6 +320,35 @@
   serialize through a character encoding change.
 -->
 
+<!--
+TODO: Things that are only implemented by a couple of browsers and may or may
+not be useful to spec:
+
+* decreaseFontSize, increaseFontSize: Only implemented in Gecko and Opera.
+* contentReadOnly, enableInlineTableEditing, enableObjectResizing, heading,
+  insertBrOnReturn: MDC docs say not implemented in IE (didn't test).
+* readOnly: MDC docs say it's a deprecated equivalent of contentReadOnly, so
+  presumably like useCSS but less popular.
+* 2D-Position, absolutePosition, clearAuthenticationCache, createBookmark,
+  insertButton, insertFieldset, insertIframe, insertInput*, insertMarquee,
+  insertSelectDropdown, insertSelectListbox, insertTextarea, liveResize,
+  multipleSelection, overwrite, print, refresh, saveAs, unbookmark: Mentioned
+  in MSDN docs but not MDC, so presumably IE-only.  Some of these seem
+  inappropriate or useless, others will bear investigation.
+* findString, fontSizeDelta, insertNewlineInQuotedContent, justifyNone, print,
+  transpose: There's code for these in WebKit,
+  Source/WebCore/editing/EditorCommand.cpp, but I didn't see them mentioned
+  elsewhere.  Some might be worth adding.
+* unselect: Seems to not be implemented by Gecko or Opera, and IE behaves
+  oddly: it seems to collapse the selection instead of removing it.  Will only
+  implement if there seems to be demand; it's redundant to
+  Selection.removeAllRanges() anyway.
+
+Things I haven't looked at that multiple browsers implement:
+
+* redo, undo: Needs review of the Google work on this; will probably be
+  quite complicated.
+-->
 
 
 <h2 id=commands><span class=secno>3 </span>Commands</h2>
--- a/implementation.js	Wed Jul 13 11:10:27 2011 -0600
+++ b/implementation.js	Wed Jul 13 11:19:57 2011 -0600
@@ -274,9 +274,9 @@
 	return getDirectionality(element.parentNode);
 }
 
+
 //@}
 
-
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////// DOM Range functions /////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
@@ -512,9 +512,9 @@
 		"currentColor": false,
 	}[color];
 }
+
 //@}
 
-
 //////////////////////////////////////////////////////////////////////////////
 /////////////////////////// Edit command functions ///////////////////////////
 //////////////////////////////////////////////////////////////////////////////
@@ -1122,8 +1122,8 @@
 	removeExtraneousLineBreaksAtTheEndOf(node);
 }
 
+
 //@}
-
 ///// Wrapping a list of nodes /////
 //@{
 
@@ -1282,8 +1282,8 @@
 	return newParent;
 }
 
+
 //@}
-
 ///// Allowed children /////
 //@{
 
@@ -1456,9 +1456,9 @@
 	return true;
 }
 
+
 //@}
 
-
 //////////////////////////////////////
 ///// Inline formatting commands /////
 //////////////////////////////////////
@@ -1723,8 +1723,8 @@
 	return false;
 }
 
+
 //@}
-
 ///// Assorted inline formatting command algorithms /////
 //@{
 
@@ -2150,8 +2150,8 @@
 	});
 }
 
+
 //@}
-
 ///// Clearing an element's value /////
 //@{
 
@@ -2260,8 +2260,8 @@
 	return [setTagName(element, "span")];
 }
 
+
 //@}
-
 ///// Pushing down values /////
 //@{
 
@@ -2369,8 +2369,8 @@
 	}
 }
 
+
 //@}
-
 ///// Forcing the value of a node /////
 //@{
 
@@ -2690,8 +2690,8 @@
 	}
 }
 
+
 //@}
-
 ///// Setting the selection's value /////
 //@{
 
@@ -2756,8 +2756,8 @@
 	});
 }
 
+
 //@}
-
 ///// The backColor command /////
 //@{
 commands.backcolor = {
@@ -2809,8 +2809,8 @@
 		return value;
 	}, relevantCssProperty: "backgroundColor"
 };
+
 //@}
-
 ///// The bold command /////
 //@{
 commands.bold = {
@@ -2845,8 +2845,8 @@
 			|| fontWeight === "900";
 	})}, relevantCssProperty: "fontWeight"
 };
+
 //@}
-
 ///// The createLink command /////
 //@{
 commands.createlink = {
@@ -2876,8 +2876,8 @@
 		setSelectionValue("createlink", value);
 	}
 };
+
 //@}
-
 ///// The fontName command /////
 //@{
 commands.fontname = {
@@ -2900,8 +2900,8 @@
 		return getEffectiveCommandValue(getActiveRange().startContainer, "fontname");
 	}, relevantCssProperty: "fontFamily"
 };
+
 //@}
-
 ///// The fontSize command /////
 //@{
 commands.fontsize = {
@@ -3041,8 +3041,8 @@
 		return "7";
 	}, relevantCssProperty: "fontSize"
 };
+
 //@}
-
 ///// The foreColor command /////
 //@{
 commands.forecolor = {
@@ -3095,8 +3095,8 @@
 		return value;
 	}, relevantCssProperty: "color"
 };
+
 //@}
-
 ///// The hiliteColor command /////
 //@{
 commands.hilitecolor = {
@@ -3149,8 +3149,8 @@
 		return value;
 	}, relevantCssProperty: "backgroundColor"
 };
+
 //@}
-
 ///// The italic command /////
 //@{
 commands.italic = {
@@ -3178,8 +3178,8 @@
 		return value == "italic" || value == "oblique";
 	})}, relevantCssProperty: "fontStyle"
 };
+
 //@}
-
 ///// The removeFormat command /////
 //@{
 commands.removeformat = {
@@ -3279,8 +3279,8 @@
 		});
 	}
 };
+
 //@}
-
 ///// The strikethrough command /////
 //@{
 commands.strikethrough = {
@@ -3305,8 +3305,8 @@
 		return getEffectiveCommandValue(node, "strikethrough") == "line-through";
 	})}
 };
+
 //@}
-
 ///// The subscript command /////
 //@{
 commands.subscript = {
@@ -3341,8 +3341,8 @@
 		return getEffectiveCommandValue(node, "subscript") == "sub";
 	})}, relevantCssProperty: "verticalAlign"
 };
+
 //@}
-
 ///// The superscript command /////
 //@{
 commands.superscript = {
@@ -3378,8 +3378,8 @@
 		return getEffectiveCommandValue(node, "superscript") == "super";
 	})}, relevantCssProperty: "verticalAlign"
 };
+
 //@}
-
 ///// The underline command /////
 //@{
 commands.underline = {
@@ -3404,8 +3404,8 @@
 		return getEffectiveCommandValue(node, "underline") === "underline";
 	})}
 };
+
 //@}
-
 ///// The unlink command /////
 //@{
 commands.unlink = {
@@ -3448,9 +3448,9 @@
 		}
 	}
 };
+
 //@}
 
-
 /////////////////////////////////////
 ///// Block formatting commands /////
 /////////////////////////////////////
@@ -3534,8 +3534,8 @@
 // "The default single-line container name is "p"."
 var defaultSingleLineContainerName = "p";
 
+
 //@}
-
 ///// Assorted block formatting command algorithms /////
 //@{
 
@@ -3771,8 +3771,8 @@
 	// "Return "left"."
 	return "left";
 }
+
 //@}
-
 ///// Block-extending a range /////
 //@{
 
@@ -3960,8 +3960,8 @@
 	return getPosition(newRange.endContainer, newRange.endOffset, node, offset) != "after";
 }
 
+
 //@}
-
 ///// Deleting the contents of a range /////
 //@{
 
@@ -4451,8 +4451,8 @@
 	}
 }
 
+
 //@}
-
 ///// Splitting a node list's parent /////
 //@{
 
@@ -4597,8 +4597,8 @@
 	}
 }
 
+
 //@}
-
 ///// Canonical space sequences /////
 //@{
 
@@ -4820,8 +4820,8 @@
 	}
 }
 
+
 //@}
-
 ///// Indenting and outdenting /////
 //@{
 
@@ -5026,8 +5026,8 @@
 	outdentNode(originalAncestor);
 }
 
+
 //@}
-
 ///// Toggling lists /////
 //@{
 
@@ -5293,8 +5293,8 @@
 	}
 }
 
+
 //@}
-
 ///// Justifying the selection /////
 //@{
 
@@ -5408,8 +5408,8 @@
 	}
 }
 
+
 //@}
-
 ///// The delete command /////
 //@{
 commands["delete"] = {
@@ -5728,8 +5728,8 @@
 		deleteContents(startNode, startOffset, node, offset);
 	}
 };
+
 //@}
-
 ///// The formatBlock command /////
 //@{
 commands.formatblock = {
@@ -5951,8 +5951,8 @@
 		return "";
 	}
 };
+
 //@}
-
 ///// The forwardDelete command /////
 //@{
 commands["forwarddelete"] = {
@@ -6147,8 +6147,8 @@
 		deleteContents(node, offset, endNode, endOffset);
 	}
 };
+
 //@}
-
 ///// The indent command /////
 //@{
 commands.indent = {
@@ -6225,8 +6225,8 @@
 		}
 	}
 };
+
 //@}
-
 ///// The insertHorizontalRule command /////
 //@{
 commands.inserthorizontalrule = {
@@ -6301,8 +6301,8 @@
 		getSelection().addRange(range);
 	}
 };
+
 //@}
-
 ///// The insertHTML command /////
 //@{
 commands.inserthtml = {
@@ -6365,8 +6365,8 @@
 		}
 	}
 };
+
 //@}
-
 ///// The insertImage command /////
 //@{
 commands.insertimage = {
@@ -6426,8 +6426,8 @@
 		img.removeAttribute("height");
 	}
 };
+
 //@}
-
 ///// The insertLineBreak command /////
 //@{
 commands.insertlinebreak = {
@@ -6500,8 +6500,8 @@
 		}
 	}
 };
+
 //@}
-
 ///// The insertOrderedList command /////
 //@{
 commands.insertorderedlist = {
@@ -6513,8 +6513,8 @@
 	// "True if the selection's list state is "ol", false otherwise."
 	state: function() { return getSelectionListState() == "ol" },
 };
+
 //@}
-
 ///// The insertParagraph command /////
 //@{
 commands.insertparagraph = {
@@ -6816,8 +6816,8 @@
 		range.setStart(newContainer, 0);
 	}
 };
+
 //@}
-
 ///// The insertText command /////
 //@{
 commands.inserttext = {
@@ -6935,8 +6935,8 @@
 		getActiveRange().setEnd(text, text.length);
 	}
 };
+
 //@}
-
 ///// The insertUnorderedList command /////
 //@{
 commands.insertunorderedlist = {
@@ -6948,8 +6948,8 @@
 	// "True if the selection's list state is "ul", false otherwise."
 	state: function() { return getSelectionListState() == "ul" },
 };
+
 //@}
-
 ///// The justifyCenter command /////
 //@{
 commands.justifycenter = {
@@ -6989,8 +6989,8 @@
 		}
 	},
 };
+
 //@}
-
 ///// The justifyFull command /////
 //@{
 commands.justifyfull = {
@@ -7030,8 +7030,8 @@
 		}
 	},
 };
+
 //@}
-
 ///// The justifyLeft command /////
 //@{
 commands.justifyleft = {
@@ -7071,8 +7071,8 @@
 		}
 	},
 };
+
 //@}
-
 ///// The justifyRight command /////
 //@{
 commands.justifyright = {
@@ -7112,8 +7112,8 @@
 		}
 	},
 };
+
 //@}
-
 ///// The outdent command /////
 //@{
 commands.outdent = {
@@ -7195,9 +7195,9 @@
 		}
 	}
 };
+
 //@}
 
-
 //////////////////////////////////
 ///// Miscellaneous commands /////
 //////////////////////////////////
@@ -7229,8 +7229,8 @@
 		}
 	}
 };
+
 //@}
-
 ///// The styleWithCSS command /////
 //@{
 commands.stylewithcss = {
@@ -7241,8 +7241,8 @@
 		cssStylingFlag = String(value).toLowerCase() != "false";
 	}, state: function() { return cssStylingFlag }
 };
+
 //@}
-
 ///// The useCSS command /////
 //@{
 commands.usecss = {
@@ -7253,8 +7253,8 @@
 		cssStylingFlag = String(value).toLowerCase() == "false";
 	}
 };
+
 //@}
-
 (function() {
 	// "If a command does not have a relevant CSS property specified, it
 	// defaults to null."
--- a/source.html	Wed Jul 13 11:10:27 2011 -0600
+++ b/source.html	Wed Jul 13 11:19:57 2011 -0600
@@ -68,36 +68,6 @@
 <h2 class=no-num>Table of contents</h2>
 <!--toc-->
 
-<!--
-Things that are only implemented by a couple of browsers and may or may not be
-useful to spec:
-
-* decreaseFontSize, increaseFontSize: Only implemented in Gecko and Opera.
-* contentReadOnly, enableInlineTableEditing, enableObjectResizing, heading,
-  insertBrOnReturn: MDC docs say not implemented in IE (didn't test).
-* readOnly: MDC docs say it's a deprecated equivalent of contentReadOnly, so
-  presumably like useCSS but less popular.
-* 2D-Position, absolutePosition, clearAuthenticationCache, createBookmark,
-  insertButton, insertFieldset, insertIframe, insertInput*, insertMarquee,
-  insertSelectDropdown, insertSelectListbox, insertTextarea, liveResize,
-  multipleSelection, overwrite, print, refresh, saveAs, unbookmark: Mentioned
-  in MSDN docs but not MDC, so presumably IE-only.  Some of these seem
-  inappropriate or useless, others will bear investigation.
-* findString, fontSizeDelta, insertNewlineInQuotedContent, justifyNone, print,
-  transpose: There's code for these in WebKit,
-  Source/WebCore/editing/EditorCommand.cpp, but I didn't see them mentioned
-  elsewhere.  Some might be worth adding.
-* unselect: Seems to not be implemented by Gecko or Opera, and IE behaves
-  oddly: it seems to collapse the selection instead of removing it.  Will only
-  implement if there seems to be demand; it's redundant to
-  Selection.removeAllRanges() anyway.
-
-Things I haven't looked at that multiple browsers implement:
-
-* redo, undo: Needs review of the Google work on this; will probably be
-  quite complicated.
--->
-
 <h2>Introduction</h2>
 <!-- @{ -->
 <p>This specification defines commands to edit HTML documents programmatically.
@@ -280,6 +250,35 @@
   serialize through a character encoding change.
 -->
 
+<!--
+TODO: Things that are only implemented by a couple of browsers and may or may
+not be useful to spec:
+
+* decreaseFontSize, increaseFontSize: Only implemented in Gecko and Opera.
+* contentReadOnly, enableInlineTableEditing, enableObjectResizing, heading,
+  insertBrOnReturn: MDC docs say not implemented in IE (didn't test).
+* readOnly: MDC docs say it's a deprecated equivalent of contentReadOnly, so
+  presumably like useCSS but less popular.
+* 2D-Position, absolutePosition, clearAuthenticationCache, createBookmark,
+  insertButton, insertFieldset, insertIframe, insertInput*, insertMarquee,
+  insertSelectDropdown, insertSelectListbox, insertTextarea, liveResize,
+  multipleSelection, overwrite, print, refresh, saveAs, unbookmark: Mentioned
+  in MSDN docs but not MDC, so presumably IE-only.  Some of these seem
+  inappropriate or useless, others will bear investigation.
+* findString, fontSizeDelta, insertNewlineInQuotedContent, justifyNone, print,
+  transpose: There's code for these in WebKit,
+  Source/WebCore/editing/EditorCommand.cpp, but I didn't see them mentioned
+  elsewhere.  Some might be worth adding.
+* unselect: Seems to not be implemented by Gecko or Opera, and IE behaves
+  oddly: it seems to collapse the selection instead of removing it.  Will only
+  implement if there seems to be demand; it's redundant to
+  Selection.removeAllRanges() anyway.
+
+Things I haven't looked at that multiple browsers implement:
+
+* redo, undo: Needs review of the Google work on this; will probably be
+  quite complicated.
+-->
 <!-- @} -->
 
 <h2>Commands</h2>
@@ -353,8 +352,8 @@
   and is not exposed to authors.  If a <span>command</span> does not have a
   <span>relevant CSS property</span> specified, it defaults to null.
 </ul>
+
 <!-- @} -->
-
 <h3>Supported commands</h3>
 <!-- @{ -->
 <p>Some <span title=command>commands</span> will be <dfn>supported</dfn> in a
@@ -392,8 +391,8 @@
 
 <p>Authors can tell whether a <span>command</span> is <span>supported</span>
 using <code>queryCommandSupported()</code>.
+
 <!-- @} -->
-
 <h3>Enabled commands</h3>
 <!-- @{ -->
 <p>At any given time, a <span>supported</span> command can be either
@@ -437,9 +436,9 @@
 about the active range.  If there are use-cases for it to be more precise, I
 could make it so.
 -->
+
 <!-- @} -->
 
-
 <h2>Methods of the <code data-anolis-spec=html>HTMLDocument</code> interface</h2>
 <!-- @{ -->
 <p>When the <dfn title=execCommand()><code>execCommand(<var>command</var>,
@@ -842,8 +841,8 @@
 <p>To <dfn>remove extraneous line breaks from</dfn> a [[node]], first
 <span>remove extraneous line breaks before</span> it, then <span>remove
 extraneous line breaks at the end of</span> it.
+
 <!-- @} -->
-
 <h3>Wrapping a list of nodes</h3>
 <!-- @{ -->
 <p>To <dfn>wrap</dfn> a list <var>node list</var> of consecutive [[sibling]]
@@ -1012,8 +1011,8 @@
 
   <li>Return <var>new parent</var>.
 </ol>
+
 <!-- @} -->
-
 <h3>Allowed children</h3>
 <!-- @{ -->
 <p>A <dfn>name of an element with inline contents</dfn> is "a", "abbr", "b",
@@ -1255,8 +1254,8 @@
 
 <p class=note>Conceptually, a simple modifiable element is a modifiable element
 which specifies a value for at most one command.
+
 <!-- @} -->
-
 <h3>Assorted inline formatting command algorithms</h3>
 <!-- @{ -->
 <p>The <dfn>effective command value</dfn> of a [[node]] <var>node</var> for a
@@ -1546,8 +1545,8 @@
   </ol>
 </ol>
 
+
 <!-- @} -->
-
 <h3>Clearing an element's value</h3>
 <!-- @{ -->
 <p>To <dfn>clear the value</dfn> of an [[element]] <var>element</var>:
@@ -1622,8 +1621,8 @@
   <li><span>Set the tag name</span> of <var>element</var> to "span", and return
   the one-[[node]] list consisting of the result.
 </ol>
+
 <!-- @} -->
-
 <h3>Pushing down values</h3>
 <!-- @{ -->
 <p>To <dfn>push down values</dfn> to a [[node]] <var>node</var>, given a new
@@ -1769,8 +1768,8 @@
     </ol>
   </ol>
 </ol>
+
 <!-- @} -->
-
 <h3>Forcing the value of a node</h3>
 <!-- @{ -->
 <p>To <dfn>force the value</dfn> of a [[node]] <var>node</var> to <var>new
@@ -2051,8 +2050,8 @@
     </ol>
   </ol>
 </ol>
+
 <!-- @} -->
-
 <h3>Setting the selection's value</h3>
 <!-- @{ -->
 <p>To <dfn>set the selection's value</dfn> to <var>new value</var>:
@@ -2201,8 +2200,8 @@
     <li><span>Force the value</span> of <var>node</var>.
   </ol>
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>backColor</code> command</dfn></h3>
 <!-- @{ -->
 <!--
@@ -2262,8 +2261,8 @@
 must always be either an element or a text node that's the child of an element.
 
 <p><span>Relevant CSS property</span>: "background-color"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>bold</code> command</dfn></h3>
 <!-- @{ -->
 <!-- If the selection is collapsed (but not if it contains nothing but is not
@@ -2315,8 +2314,8 @@
 -->
 
 <p><span>Relevant CSS property</span>: "font-weight"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>createLink</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -2380,8 +2379,8 @@
 
 <!-- I'd have expected the value to be the URL, but guess not: it's always
 false. -->
+
 <!-- @} -->
-
 <h3><dfn>The <code title>fontName</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: <span>Set the selection's value</span> to
@@ -2436,8 +2435,8 @@
 applicable style rules. -->
 
 <p><span>Relevant CSS property</span>: "font-family"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>fontSize</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -2608,8 +2607,8 @@
 </ol>
 
 <p><span>Relevant CSS property</span>: "font-size"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>foreColor</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -2706,8 +2705,8 @@
 -->
 
 <p><span>Relevant CSS property</span>: "color"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>hiliteColor</code> command</dfn></h3>
 <!-- @{ -->
 <!-- IE 9 RC doesn't support this.  It uses backColor instead, but Gecko and
@@ -2765,8 +2764,8 @@
 -->
 
 <p><span>Relevant CSS property</span>: "background-color"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>italic</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: If the <span>state</span> is false, <span>set the
@@ -2785,8 +2784,8 @@
 at least one such [[text]] node.  Otherwise false.
 
 <p><span>Relevant CSS property</span>: "font-style"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>removeFormat</code> command</dfn></h3>
 <!-- @{ -->
 <!--
@@ -2909,8 +2908,8 @@
     <li>underline
   </ol>
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>strikethrough</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: If the <span>state</span> is false, <span>set the
@@ -2932,8 +2931,8 @@
 is <span>effectively contained</span> in the <span>active range</span> has
 <span>effective command value</span> "line-through", and there is at least one
 such [[text]] node.  Otherwise false.
+
 <!-- @} -->
-
 <h3><dfn>The <code title>subscript</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -2972,8 +2971,8 @@
 -->
 
 <p><span>Relevant CSS property</span>: "vertical-align"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>superscript</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -3001,8 +3000,8 @@
 [[text]] node.  Otherwise false.
 
 <p><span>Relevant CSS property</span>: "vertical-align"
+
 <!-- @} -->
-
 <h3><dfn>The <code title>underline</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: If the <span>state</span> is false, <span>set the
@@ -3073,8 +3072,8 @@
 is <span>effectively contained</span> in the <span>active range</span> has
 <span>effective command value</span> "underline", and there is at least one
 such [[text]] node.  Otherwise false.
+
 <!-- @} -->
-
 <h3><dfn>The <code title>unlink</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -3128,8 +3127,8 @@
 
 <p>The <dfn>default single-line container name</dfn> is "p".
 <!-- TODO: Make this configurable. -->
+
 <!-- @} -->
-
 <h3>Assorted block formatting command algorithms</h3>
 <!-- @{ -->
 <p>To <dfn>fix disallowed ancestors</dfn> of <var>node</var>:
@@ -3362,8 +3361,8 @@
 
   <li>Return "left".
 </ol>
+
 <!-- @} -->
-
 <h3>Block-extending a range</h3>
 <!-- @{ -->
 <p>When a user agent is to <dfn>block-extend</dfn> a [[range]]
@@ -3491,8 +3490,8 @@
   <li>Return false if <var>new range</var>'s [[rangeend]] is [[bpafter]]
   (<var>node</var>, <var>offset</var>), true otherwise.
 </ol>
+
 <!-- @} -->
-
 <h3>Deleting the contents of a range</h3>
 <!-- @{ -->
 <p>To <dfn>delete the contents</dfn> of a [[range]] <var>range</var>, given a
@@ -3900,8 +3899,8 @@
   [[createelement|"br"]] on the [[contextobject]] and append the result as the
   last [[child]] of <var>start block</var>.
 </ol>
+
 <!-- @} -->
-
 <h3>Splitting a node list's parent</h3>
 <!-- @{ -->
 <p>To <dfn>split the parent</dfn> of a list <var>node list</var> of consecutive
@@ -4028,8 +4027,8 @@
 descendants</dfn>, <span>split the parent</span> of <var>node</var>'s
 [[children]] if it has any.  If it has no [[children]], instead remove it from
 its [[parent]].
+
 <!-- @} -->
-
 <h3>Canonical space sequences</h3>
 <!-- @{ -->
 <p>The <dfn>canonical space sequence</dfn> of length <var>n</var>, with boolean
@@ -4219,8 +4218,8 @@
     </ol>
   </ol>
 </ol>
+
 <!-- @} -->
-
 <h3>Indenting and outdenting</h3>
 <!-- @{ -->
 <p>To <dfn>indent</dfn> a list <var>node list</var> of consecutive [[sibling]]
@@ -4520,8 +4519,8 @@
 
   <li><span>Outdent</span> <var>original ancestor</var>.
 </ol>
+
 <!-- @} -->
-
 <h3>Toggling lists</h3>
 <!-- @{ -->
 <!--
@@ -5074,8 +5073,8 @@
     <li><span>Fix disallowed ancestors</span> of the previous step's result.
   </ol>
 </ol>
+
 <!-- @} -->
-
 <h3>Justifying the selection</h3>
 <!-- @{ -->
 <!--
@@ -5190,8 +5189,8 @@
     mode. -->
   </ol>
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>delete</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -5497,8 +5496,8 @@
   (<var>start node</var>, <var>start offset</var>) and [[rangeend]]
   (<var>node</var>, <var>offset</var>).
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>formatBlock</code> command</dfn></h3>
 <!-- @{ -->
 <!--
@@ -5791,8 +5790,8 @@
 
   <li>Return the empty string.
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>forwardDelete</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -5947,8 +5946,8 @@
   (<var>node</var>, <var>offset</var>) and [[rangeend]] (<var>end node</var>,
   <var>end offset</var>).
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>indent</code> command</dfn></h3>
 <!-- @{ -->
 <!--
@@ -6043,8 +6042,8 @@
     <li><span>Indent</span> <var>sublist</var>.
   </ol>
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>insertHorizontalRule</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -6109,8 +6108,8 @@
   to the [[parent]] of <var>hr</var> and the second argument equal to one plus
   the [[index]] of <var>hr</var>.
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>insertHTML</code> command</dfn></h3>
 <!-- @{ -->
 <!--
@@ -6211,8 +6210,8 @@
   <!-- We want to fix all descendants, not just children.  Consider
   <div><li>foo</li></div>, for example. -->
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>insertImage</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -6260,8 +6259,8 @@
   to the [[parent]] of <var>img</var> and the second argument equal to one plus
   the [[index]] of <var>img</var>.
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>insertLineBreak</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -6322,8 +6321,8 @@
   be the result, then call [[insertnode|<var>extra br</var>]] on the
   <span>active range</span>.
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>insertOrderedList</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: <span>Toggle lists</span> with <var>tag name</var>
@@ -6347,8 +6346,8 @@
 no apparent reason.  Ignoring those, the spec basically matches all browsers,
 except with a few weird random mismatches that looked like browser bugs to me.
 -->
+
 <!-- @} -->
-
 <h3><dfn>The <code title>insertParagraph</code> command</dfn></h3>
 <!-- @{ -->
 <!--
@@ -6620,8 +6619,8 @@
   <li>Set the [[rangestart]] of <var>range</var> to (<var>new container</var>,
   0).
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>insertText</code> command</dfn></h3>
 <!-- @{ -->
 <!--
@@ -6800,8 +6799,8 @@
   <li>Call [[selcollapse|<var>text</var>, 1]] on the [[contextobject]]'s
   [[selection]].
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>insertUnorderedList</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: <span>Toggle lists</span> with <var>tag name</var>
@@ -6812,8 +6811,8 @@
 
 <p><span>State</span>: True if the <span>selection's list state</span> is "ul",
 false otherwise.
+
 <!-- @} -->
-
 <h3><dfn>The <code title>justifyCenter</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: <span>Justify the selection</span> with
@@ -6877,8 +6876,8 @@
 left, but that's not the case.  Chrome 14 dev returns the state cast to a
 string, as usual.  Opera 11.11 always returns the empty string.
 -->
+
 <!-- @} -->
-
 <h3><dfn>The <code title>justifyFull</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: <span>Justify the selection</span> with
@@ -6900,8 +6899,8 @@
 and return the <span>alignment value</span> of the first <span>visible</span>
 <span>editable</span> [[node]] that is [[contained]] in the result and has no
 [[children]].  If there is no such [[node]], return "left".
+
 <!-- @} -->
-
 <h3><dfn>The <code title>justifyLeft</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: <span>Justify the selection</span> with
@@ -6923,8 +6922,8 @@
 and return the <span>alignment value</span> of the first <span>visible</span>
 <span>editable</span> [[node]] that is [[contained]] in the result and has no
 [[children]].  If there is no such [[node]], return "left".
+
 <!-- @} -->
-
 <h3><dfn>The <code title>justifyRight</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>: <span>Justify the selection</span> with
@@ -6946,8 +6945,8 @@
 and return the <span>alignment value</span> of the first <span>visible</span>
 <span>editable</span> [[node]] that is [[contained]] in the result and has no
 [[children]].  If there is no such [[node]], return "left".
+
 <!-- @} -->
-
 <h3><dfn>The <code title>outdent</code> command</dfn></h3>
 <!-- @{ -->
 <p><span>Action</span>:
@@ -7066,8 +7065,8 @@
 However, browsers might not want to encourage authors to tell users to
 reconfigure their browser insecurely.
 -->
+
 <!-- @} -->
-
 <h3><dfn>The <code title>cut</code> command</dfn></h3>
 <!-- @{ -->
 <!-- See comment for copy -->
@@ -7089,8 +7088,8 @@
 may either raise a [[SECURITY_ERR]] for non-whitelisted sites, or it may act as
 though the <span>command</span> is <span title=supported>unsupported</span> on
 those sites.
+
 <!-- @} -->
-
 <h3><dfn>The <code title>paste</code> command</dfn></h3>
 <!-- @{ -->
 <!-- See comment for copy -->
@@ -7112,8 +7111,8 @@
 may either raise a [[SECURITY_ERR]] for non-whitelisted sites, or it may act as
 though the <span>command</span> is <span title=supported>unsupported</span> on
 those sites.
+
 <!-- @} -->
-
 <h3><dfn>The <code title>selectAll</code> command</dfn></h3>
 <!-- @{ -->
 <!--
@@ -7163,8 +7162,8 @@
   <li>Otherwise, call [[getselection]] on the [[contextobject]], and call
   [[selectallchildren|<var>target</var>]] on the result.
 </ol>
+
 <!-- @} -->
-
 <h3><dfn>The <code title>styleWithCSS</code> command</dfn></h3>
 <!-- @{ -->
 <!-- IE9 and Opera 11.00 don't support this command.  By and large, they act
@@ -7194,8 +7193,8 @@
 otherwise false.
 <!-- This follows Chrome 13 dev.  Firefox 5.0a2 doesn't support
 queryCommandState() for styleWithCSS. -->
+
 <!-- @} -->
-
 <h3><dfn>The <code title>useCSS</code> command</dfn></h3>
 <!-- @{ -->
 <!-- Supported by Firefox 4.0, but not IE9 or Opera 11.00 (which don't support