Index: /CKEditor/trunk/_source/plugins/selection/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 6342)
+++ /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 6343)
@@ -1,3 +1,3 @@
-﻿/*
+﻿﻿/*
 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -600,6 +600,7 @@
 						}
 
-						// 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.
@@ -614,9 +615,13 @@
 							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 ];
-								return  { container : child, offset : child.nodeValue.length };
+
+								if ( child.nodeType == CKEDITOR.NODE_ELEMENT )
+									return { container : parent, offset : siblings.length };
+								else
+									return { container : child, offset : child.nodeValue.length };
 							}
 
