+ * Check if elements at which the range boundaries anchor are read-only,\r
+ * with respect to "contenteditable" attribute.\r
+ */\r
+ checkReadOnly : ( function()\r
+ {\r
+ function checkNodesEditable( node, anotherEnd )\r
+ {\r
+ while( node )\r
+ {\r
+ if ( node.type == CKEDITOR.NODE_ELEMENT )\r
+ {\r
+ if ( node.getAttribute( 'contentEditable' ) == 'false'\r
+ && !node.data( 'cke-editable' ) )\r
+ {\r
+ return 0;\r
+ }\r
+ // Range enclosed entirely in an editable element.\r
+ else if ( node.is( 'html' )\r
+ || node.getAttribute( 'contentEditable' ) == 'true'\r
+ && ( node.contains( anotherEnd ) || node.equals( anotherEnd ) ) )\r
+ {\r
+ break;\r
+ }\r
+ }\r
+ node = node.getParent();\r
+ }\r
+\r
+ return 1;\r
+ }\r
+\r
+ return function()\r
+ {\r
+ var startNode = this.startContainer,\r
+ endNode = this.endContainer;\r
+\r
+ // Check if elements path at both boundaries are editable.\r
+ return !( checkNodesEditable( startNode, endNode ) && checkNodesEditable( endNode, startNode ) );\r
+ };\r
+ })(),\r
+\r
+ /**\r