this.collapsed = true;\r
},\r
\r
- // The selection may be lost when cloning (due to the splitText() call).\r
+ /**\r
+ * The content nodes of the range are cloned and added to a document fragment, which is returned.\r
+ * <strong> Note: </strong> Text selection may lost after invoking this method. (caused by text node splitting).\r
+ */\r
cloneContents : function()\r
{\r
var docFrag = new CKEDITOR.dom.documentFragment( this.document );\r
return docFrag;\r
},\r
\r
+ /**\r
+ * Deletes the content nodes of the range permanently from the DOM tree.\r
+ */\r
deleteContents : function()\r
{\r
if ( this.collapsed )\r
execContentsAction( this, 0 );\r
},\r
\r
+ /**\r
+ * The content nodes of the range are cloned and added to a document fragment,\r
+ * meanwhile they're removed permanently from the DOM tree.\r
+ */\r
extractContents : function()\r
{\r
var docFrag = new CKEDITOR.dom.documentFragment( this.document );\r
// Fixing invalid range start inside dtd empty elements.\r
if( startNode.type == CKEDITOR.NODE_ELEMENT\r
&& CKEDITOR.dtd.$empty[ startNode.getName() ] )\r
- startNode = startNode.getParent(), startOffset = startNode.getIndex();\r
+ startOffset = startNode.getIndex(), startNode = startNode.getParent();\r
\r
this.startContainer = startNode;\r
this.startOffset = startOffset;\r