{\r
var lastIndex = block.children.length,\r
last = block.children[ lastIndex - 1 ];\r
- while( last && last.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim( last.value ) )\r
+ while ( last && last.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim( last.value ) )\r
last = block.children[ --lastIndex ];\r
return last;\r
}\r
function blockNeedsExtension( block )\r
{\r
var lastChild = lastNoneSpaceChild( block );\r
- return !lastChild || lastChild.type == CKEDITOR.NODE_ELEMENT && lastChild.name == 'br';\r
+\r
+ return !lastChild\r
+ || lastChild.type == CKEDITOR.NODE_ELEMENT && lastChild.name == 'br'\r
+ // Some of the controls in form needs extension too,\r
+ // to move cursor at the end of the form. (#4791)\r
+ || block.name == 'form' && lastChild.name == 'input';\r
}\r
\r
function extendBlockForDisplay( block )\r
delete blockLikeTags.pre;\r
var defaultDataFilterRules =\r
{\r
+ elements : {},\r
attributeNames :\r
[\r
// Event attributes (onXYZ) must not be directly set. They can become\r
\r
if ( !element.attributes.type )\r
element.attributes.type = 'text/css';\r
+ },\r
+\r
+ title : function( element )\r
+ {\r
+ element.children[ 0 ].value = element.attributes[ '_cke_title' ];\r
}\r
},\r
\r
};\r
}\r
\r
+ function protectReadOnly( element )\r
+ {\r
+ element.attributes.contenteditable = "false";\r
+ }\r
+ function unprotectReadyOnly( element )\r
+ {\r
+ delete element.attributes.contenteditable;\r
+ }\r
+ // Disable form elements editing mode provided by some browers. (#5746)\r
+ for ( i in { input : 1, textarea : 1 } )\r
+ {\r
+ defaultDataFilterRules.elements[ i ] = protectReadOnly;\r
+ defaultHtmlFilterRules.elements[ i ] = unprotectReadyOnly;\r
+ }\r
+\r
var protectAttributeRegex = /<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;\r
\r
var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,\r