Index: _source/plugins/selection/plugin.js
===================================================================
--- _source/plugins/selection/plugin.js	(revision 6337)
+++ _source/plugins/selection/plugin.js	(revision )
@@ -599,8 +599,9 @@
 								return { container : parent, offset : getNodeIndex( child ) };
 						}
 
-						// All childs are text nodes.
-						if ( index == -1 )
+						// All childs are text nodes,
+						// or to the right hand of test range are all text nodes. (#6992)
+						if ( index == -1 || index == siblings.length - 1 && position < 0 )
 						{
 							// Adapt test range to embrace the entire parent contents.
 							testRange.moveToElementText( parent );
@@ -613,11 +614,15 @@
 
 							siblings = parent.childNodes;
 
-							// Actual range anchor right beside test range at the inner boundary of text node.
+							// Actual range anchor right beside test range at the boundary of text node.
 							if ( !distance )
 							{
 								child = siblings[ siblings.length - 1 ];
+
+								if ( child.nodeType == CKEDITOR.NODE_ELEMENT )
+									return { container : parent, offset : siblings.length };
+								else
-								return  { container : child, offset : child.nodeValue.length };
+									return { container : child, offset : child.nodeValue.length };
 							}
 
 							// Start the measuring until distance overflows, meanwhile count the text nodes.
