JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.3
[ckeditor.git] / _source / core / dom / range.js
index b43a82d..8f10980 100644 (file)
@@ -351,7 +351,10 @@ CKEDITOR.dom.range = function( document )
                        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
@@ -362,6 +365,9 @@ CKEDITOR.dom.range = function( document )
                        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
@@ -370,6 +376,10 @@ CKEDITOR.dom.range = function( document )
                        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
@@ -1405,7 +1415,7 @@ CKEDITOR.dom.range = function( document )
                        // 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