delete command seems finished for now, yay
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Sun, 12 Jun 2011 15:08:51 -0600
changeset 262 687ca0631209
parent 261 a0c5e24746f5
child 263 f49fb6022d09
delete command seems finished for now, yay
editcommands.html
source.html
tests.js
--- a/editcommands.html	Sun Jun 12 15:00:06 2011 -0600
+++ b/editcommands.html	Sun Jun 12 15:08:51 2011 -0600
@@ -2601,6 +2601,7 @@
 
   <!--
   At the beginning of an indented block, outdent it, similar to a list item.
+  Browsers don't do this, word processors do.
   -->
   <li>If <var title="">offset</var> is zero, and <var title="">node</var> has an
   <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#ancestor-container title="ancestor container">ancestor container</a> that is both a <a href=#potential-indentation-element>potential indentation
@@ -2696,6 +2697,11 @@
   Note that this behavior is quite different from what happens if you actually
   select the linebreak in between the two lines.  In that case, the blocks are
   merged as normal.
+
+  Also note that hitting backspace twice will merge with the previous item.
+  This matches OO.org, but Word will outdent the item on subsequent backspaces.
+  Word's behavior doesn't fit well with the way lists work in HTML, and we
+  probably don't want it.
   -->
   <li>If the <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a> of <var title="">start node</var> with <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-indexof title=concept-indexof>index</a> <var title="">start
   offset</var> is an <code class=external data-anolis-spec=html title="the li element"><a href=http://www.whatwg.org/html/#the-li-element>li</a></code> or <code class=external data-anolis-spec=html title="the dt element"><a href=http://www.whatwg.org/html/#the-dt-element>dt</a></code> or <code class=external data-anolis-spec=html title="the dd element"><a href=http://www.whatwg.org/html/#the-dd-element>dd</a></code>, and that <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-child title=concept-tree-child>child</a>'s
@@ -2740,8 +2746,6 @@
   <li><a href=#delete-the-contents>Delete the contents</a> of the <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range title=concept-range>range</a> with <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-start title=concept-range-start>start</a>
   (<var title="">start node</var>, <var title="">start offset</var>) and <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#concept-range-end title=concept-range-end>end</a>
   (<var title="">node</var>, <var title="">offset</var>).
-
-  <li class=XXX>Still more cases to handle.
 </ol>
 
 
--- a/source.html	Sun Jun 12 15:00:06 2011 -0600
+++ b/source.html	Sun Jun 12 15:08:51 2011 -0600
@@ -2581,6 +2581,7 @@
 
   <!--
   At the beginning of an indented block, outdent it, similar to a list item.
+  Browsers don't do this, word processors do.
   -->
   <li>If <var>offset</var> is zero, and <var>node</var> has an
   [[ancestorcontainer]] that is both a <span>potential indentation
@@ -2676,6 +2677,11 @@
   Note that this behavior is quite different from what happens if you actually
   select the linebreak in between the two lines.  In that case, the blocks are
   merged as normal.
+
+  Also note that hitting backspace twice will merge with the previous item.
+  This matches OO.org, but Word will outdent the item on subsequent backspaces.
+  Word's behavior doesn't fit well with the way lists work in HTML, and we
+  probably don't want it.
   -->
   <li>If the [[child]] of <var>start node</var> with [[index]] <var>start
   offset</var> is an [[li]] or [[dt]] or [[dd]], and that [[child]]'s
@@ -2720,8 +2726,6 @@
   <li><span>Delete the contents</span> of the [[range]] with [[rangestart]]
   (<var>start node</var>, <var>start offset</var>) and [[rangeend]]
   (<var>node</var>, <var>offset</var>).
-
-  <li class=XXX>Still more cases to handle.
 </ol>
 
 
--- a/tests.js	Sun Jun 12 15:00:06 2011 -0600
+++ b/tests.js	Sun Jun 12 15:08:51 2011 -0600
@@ -321,6 +321,13 @@
 		'<dl><dt>foo<dt>[]bar<dd>baz</dl>',
 		'<dl><dt>foo<dd>bar<dd>[]baz</dl>',
 
+		'<ol><li>foo</ol>[]bar',
+		'<ol><li>foo<br></ol>[]bar',
+		'<ol><li>foo<br><br></ol>[]bar',
+
+		'<ol><li><br></ol>[]bar',
+		'<ol><li>foo<li><br></ol>[]bar',
+
 		// Indented stuff with collapsed selection
 		'foo<blockquote>[]bar</blockquote>',
 		'foo<blockquote><blockquote>[]bar</blockquote></blockquote>',