// current style definition.\r
checkElementRemovable : function( element, fullMatch )\r
{\r
- if ( !element || element.isReadOnly() )\r
+ var def = this._.definition;\r
+\r
+ if ( !element || !def.ignoreReadonly && element.isReadOnly() )\r
return false;\r
\r
- var def = this._.definition,\r
- attribs,\r
+ var attribs,\r
name = element.getName();\r
\r
// If the element name is the same as the style name.\r
var isUnknownElement;\r
\r
// Indicates that fully selected read-only elements are to be included in the styling range.\r
- var includeReadonly = def.includeReadonly;\r
+ var ignoreReadonly = def.ignoreReadonly,\r
+ includeReadonly = ignoreReadonly || def.includeReadonly;\r
\r
// If the read-only inclusion is not available in the definition, try\r
// to get it from the document data.\r
\r
var styleRange;\r
\r
- // Check if the boundaries are inside non stylable elements.\r
- var firstUnstylable = getUnstylableParent( firstNode ),\r
- lastUnstylable = getUnstylableParent( lastNode );\r
-\r
- // If the first element can't be styled, we'll start processing right\r
- // after its unstylable root.\r
- if ( firstUnstylable )\r
- currentNode = firstUnstylable.getNextSourceNode( true );\r
-\r
- // If the last element can't be styled, we'll stop processing on its\r
- // unstylable root.\r
- if ( lastUnstylable )\r
- lastNode = lastUnstylable;\r
+ if ( !ignoreReadonly )\r
+ {\r
+ // Check if the boundaries are inside non stylable elements.\r
+ var firstUnstylable = getUnstylableParent( firstNode ),\r
+ lastUnstylable = getUnstylableParent( lastNode );\r
+\r
+ // If the first element can't be styled, we'll start processing right\r
+ // after its unstylable root.\r
+ if ( firstUnstylable )\r
+ currentNode = firstUnstylable.getNextSourceNode( true );\r
+\r
+ // If the last element can't be styled, we'll stop processing on its\r
+ // unstylable root.\r
+ if ( lastUnstylable )\r
+ lastNode = lastUnstylable;\r
+ }\r
\r
// Do nothing if the current node now follows the last node to be processed.\r
if ( currentNode.getPosition( lastNode ) == CKEDITOR.POSITION_FOLLOWING )\r
breakNodes();\r
\r
// Now, do the DFS walk.\r
- var currentNode = startNode.getNext();\r
+ var currentNode = startNode;\r
while ( !currentNode.equals( endNode ) )\r
{\r
/*\r
var style = this,\r
def = style._.definition,\r
attributes = def.attributes;\r
- var styles = CKEDITOR.style.getStyleText( def );\r
\r
// Remove all defined attributes.\r
if ( attributes )\r