+ * Replace special HTML characters in HTMLElement's attribute with their relative HTML entity values.\r
+ * @param {String} The attribute's value to be encoded.\r
+ * @returns {String} The encode value.\r
+ * @example\r
+ * element.setAttribute( 'title', '<a " b >' );\r
+ * alert( CKEDITOR.tools.htmlEncodeAttr( element.getAttribute( 'title' ) ); // ">a " b <"\r
+ */\r
+ htmlEncodeAttr : function( text )\r
+ {\r
+ return text.replace( /"/g, '"' ).replace( /</g, '<' ).replace( />/, '>' );\r
+ },\r
+\r
+ /**\r
+ * Replace characters can't be represented through CSS Selectors string\r
+ * by CSS Escape Notation where the character escape sequence consists\r
+ * of a backslash character (\) followed by the orginal characters.\r
+ * Ref: http://www.w3.org/TR/css3-selectors/#grammar\r
+ * @param cssSelectText\r
+ * @return the escaped selector text.\r
+ */\r
+ escapeCssSelector : function( cssSelectText )\r
+ {\r
+ return cssSelectText.replace( /[\s#:.,$*^\[\]()~=+>]/g, '\\$&' );\r
+ },\r
+\r
+ /**\r