Index: /FCKeditor/trunk/editor/_source/classes/fckdomrange.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckdomrange.js	(revision 905)
+++ /FCKeditor/trunk/editor/_source/classes/fckdomrange.js	(revision 906)
@@ -562,5 +562,5 @@
 				}
 
-				if ( this.EndBlock && FCKConfig.EnterMode != 'br' && unit == 'block_contents' )
+				if ( this.EndBlock && FCKConfig.EnterMode != 'br' && unit == 'block_contents' && this.EndBlock.nodeName.toLowerCase() != 'li' )
 					this.SetEnd( this.EndBlock, 2 ) ;
 				else
@@ -754,4 +754,26 @@
 			return '' ;
 		return this._Range.toString() ;
+	},
+	
+	GetTouchedStartNode : function()
+	{
+		var range = this._Range ;
+		var container = range.startContainer ;
+		
+		if ( range.collapsed || container.nodeType != 1 )
+			return container ;
+		
+		return container.childNodes[ range.startOffset ] || container ;
+	},
+	
+	GetTouchedEndNode : function()
+	{
+		var range = this._Range ;
+		var container = range.endContainer ;
+		
+		if ( range.collapsed || container.nodeType != 1 )
+			return container ;
+		
+		return container.childNodes[ range.endOffset - 1 ] || container ;
 	}
 } ;
Index: /FCKeditor/trunk/editor/_source/classes/fckdomrangeiterator.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckdomrangeiterator.js	(revision 905)
+++ /FCKeditor/trunk/editor/_source/classes/fckdomrangeiterator.js	(revision 906)
@@ -77,5 +77,5 @@
 		var boundarySet = this.ForceBrBreak ? FCKListsLib.ListBoundaries : FCKListsLib.BlockBoundaries ;
 
-		// This is the first interaction. Let's initialize it.
+		// This is the first iteration. Let's initialize it.
 		if ( !this._LastNode )
 		{
@@ -83,6 +83,6 @@
 			range.Expand( this.ForceBrBreak ? 'list_contents' : 'block_contents' ) ;
 
-			this._NextNode = range.StartNode ;
-			this._LastNode = range.EndNode ;
+			this._NextNode = range.GetTouchedStartNode() ;
+			this._LastNode = range.GetTouchedEndNode() ;
 
 			// Let's reuse this variable.
@@ -122,4 +122,5 @@
 						// the range yet, it means we must return this block.
 						block = currentNode ;
+						isLast = currentNode == lastNode ;
 						break ;
 					}
@@ -162,5 +163,6 @@
 
 			// The last node has been found.
-			isLast = ( currentNode == lastNode ) ;
+			isLast = ( ( !closeRange || includeNode ) && currentNode == lastNode ) ;
+//			isLast = ( currentNode == lastNode && ( currentNode.nodeType != 1 || currentNode.childNodes.length == 0 ) ) ;
 
 			// If we are in an element boundary, let's check if it is time
@@ -174,4 +176,5 @@
 					{
 						closeRange = true ;
+						isLast = isLast || ( parentNode == lastNode ) ;
 						break ;
 					}
@@ -193,6 +196,7 @@
 				range._UpdateElementInfo() ;
 				
-				if ( range.StartNode == range.EndNode && 
-						range.StartNode.getAttribute && range.StartNode.getAttribute( '_fck_bookmark' ) )
+				if ( range.StartNode == range.EndNode 
+						&& range.StartNode.parentNode == range.StartBlockLimit 
+						&& range.StartNode.getAttribute && range.StartNode.getAttribute( '_fck_bookmark' ) )
 					range = null ;
 				else
@@ -203,5 +207,5 @@
 				break ;
 
-			currentNode = FCKDomTools.GetNextSourceNode( currentNode, continueFromSibling ) ;
+			currentNode = FCKDomTools.GetNextSourceNode( currentNode, continueFromSibling, null, lastNode ) ;
 		}
 
@@ -273,5 +277,5 @@
 				// lists) or the next sibling <li>.
 
-				this._NextNode = FCKDomTools.GetNextSourceNode( range.EndNode, true ) ;
+				this._NextNode = block == lastNode ? null : FCKDomTools.GetNextSourceNode( range.EndNode, true, null, lastNode ) ;
 				return block ;
 			}
@@ -295,5 +299,5 @@
 		// above block can be removed or changed, so we can rely on it for the
 		// next interation.
-		this._NextNode = isLast ? null : FCKDomTools.GetNextSourceNode( block, true ) ;
+		this._NextNode = ( isLast || block == lastNode ) ? null : FCKDomTools.GetNextSourceNode( block, true, null, lastNode ) ;
 
 		return block ;
Index: /FCKeditor/trunk/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckdomtools.js	(revision 905)
+++ /FCKeditor/trunk/editor/_source/internals/fckdomtools.js	(revision 906)
@@ -265,5 +265,5 @@
 	 * Get the next DOM node available in source order.
 	 */
-	GetNextSourceNode : function( currentNode, startFromSibling, nodeType )
+	GetNextSourceNode : function( currentNode, startFromSibling, nodeType, stopSearchElement )
 	{
 		if ( !currentNode )
@@ -275,8 +275,13 @@
 			node = currentNode.firstChild ;
 		else
-			node = ( currentNode.nextSibling || this.GetNextSourceNode( currentNode.parentNode, true, nodeType ) ) ;
+		{
+			node = currentNode.nextSibling ;
+			
+			if ( !node && ( !stopSearchElement || stopSearchElement != currentNode.parentNode ) )
+				return this.GetNextSourceNode( currentNode.parentNode, true, nodeType, stopSearchElement ) ;
+		}
 
 		if ( nodeType && node && node.nodeType != nodeType )
-			return this.GetNextSourceNode( node, false, nodeType ) ;
+			return this.GetNextSourceNode( node, false, nodeType, stopSearchElement ) ;
 
 		return node ;
@@ -493,5 +498,6 @@
 	Contains : function( mainElement, otherElement )
 	{
-		if ( mainElement.contains )
+		// IE supports contains, but only for element nodes.
+		if ( mainElement.contains && otherElement.nodeType == 1 )
 			return mainElement.contains( otherElement ) ;
 
Index: /FCKeditor/trunk/editor/_source/internals/fcklistslib.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fcklistslib.js	(revision 905)
+++ /FCKeditor/trunk/editor/_source/internals/fcklistslib.js	(revision 906)
@@ -44,5 +44,5 @@
 
 	// Elements that may be considered the "Block boundary" in an element path.
-	PathBlockElements : { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1 },
+	PathBlockElements : { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },
 
 	// Elements that may be considered the "Block limit" in an element path.
