Nitpick
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Mon, 16 May 2011 15:24:48 -0600
changeset 132 c5bcebfcca46
parent 131 59bfd08fbd1b
child 133 90eaf6cf8106
Nitpick
editcommands.html
implementation.js
source.html
--- a/editcommands.html	Mon May 16 15:23:48 2011 -0600
+++ b/editcommands.html	Mon May 16 15:24:48 2011 -0600
@@ -2995,8 +2995,8 @@
   <li>For each <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-node title=concept-node>node</a> <var title="">node</var> <a class=external data-anolis-spec=domrange href=http://html5.org/specs/dom-range.html#contained>contained</a> in <var title="">new range</var>:
 
   <ol>
-    <li>If the last member of <var title="">node list</var> is an <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-ancestor title=concept-tree-ancestor>ancestor</a> of
-    <var title="">node</var>, or if <var title="">node</var> is not <a href=#editable>editable</a>,
+    <li>If the last member of <var title="">node list</var> (if any) is an <a class=external data-anolis-spec=domcore href=http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-tree-ancestor title=concept-tree-ancestor>ancestor</a>
+    of <var title="">node</var>, or if <var title="">node</var> is not <a href=#editable>editable</a>,
     continue with the next <var title="">node</var>.
 
     <!--
--- a/implementation.js	Mon May 16 15:23:48 2011 -0600
+++ b/implementation.js	Mon May 16 15:24:48 2011 -0600
@@ -2864,9 +2864,9 @@
 				continue;
 			}
 
-			// "If the last member of node list is an ancestor of node, or if
-			// node is not editable, continue with the next node."
-			if (isAncestor(nodeList[nodeList.length - 1], node)
+			// "If the last member of node list (if any) is an ancestor of
+			// node, or if node is not editable, continue with the next node."
+			if ((nodeList.length && isAncestor(nodeList[nodeList.length - 1], node))
 			|| !isEditable(node)) {
 				continue;
 			}
--- a/source.html	Mon May 16 15:23:48 2011 -0600
+++ b/source.html	Mon May 16 15:24:48 2011 -0600
@@ -3043,8 +3043,8 @@
   <li>For each [[node]] <var>node</var> [[contained]] in <var>new range</var>:
 
   <ol>
-    <li>If the last member of <var>node list</var> is an [[ancestor]] of
-    <var>node</var>, or if <var>node</var> is not <span>editable</span>,
+    <li>If the last member of <var>node list</var> (if any) is an [[ancestor]]
+    of <var>node</var>, or if <var>node</var> is not <span>editable</span>,
     continue with the next <var>node</var>.
 
     <!--