Match implementation to spec
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 05 May 2011 15:20:38 -0600
changeset 91 930e3d99e27a
parent 90 e4c38155e8b4
child 92 36c20a06b86e
Match implementation to spec

Somehow a line in the spec got lost from the implementation.
implementation.js
--- a/implementation.js	Thu May 05 15:03:30 2011 -0600
+++ b/implementation.js	Thu May 05 15:20:38 2011 -0600
@@ -2253,6 +2253,17 @@
 			nodeList.push(node);
 		}
 
+		// "If the first member of node list is an li whose parent is an ol or
+		// ul, and its previousSibling is an li as well, normalize sublists of
+		// its previousSibling."
+		if (nodeList.length
+		&& isHtmlElement(nodeList[0], "LI")
+		&& (isHtmlElement(nodeList[0].parentNode, "OL")
+			|| isHtmlElement(nodeList[0].parentNode, "UL"))
+		&& isHtmlElement(nodeList[0].previousSibling, "LI")) {
+			normalizeSublists(nodeList[0].previousSibling);
+		}
+
 		// "Indent each member of node list."
 		for (var i = 0; i < nodeList.length; i++) {
 			indentNode(nodeList[i]);