/*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
lastChild = lastChild.getPrevious();\r
if ( !lastChild || !lastChild.is || !lastChild.is( 'br' ) )\r
{\r
- this.append(\r
- CKEDITOR.env.opera ?\r
+ var bogus = CKEDITOR.env.opera ?\r
this.getDocument().createText('') :\r
- this.getDocument().createElement( 'br' ) );\r
+ this.getDocument().createElement( 'br' );\r
+\r
+ CKEDITOR.env.gecko && bogus.setAttribute( 'type', '_moz' );\r
+\r
+ this.append( bogus );\r
}\r
},\r
\r
* @param {CKEDITOR.dom.element} parent The anscestor element to get broken.\r
* @example\r
* // Before breaking:\r
- * // <b>This <i>is some<span /> sample</i> test text</b>\r
- * // If "element" is <span /> and "parent" is <i>:\r
- * // <b>This <i>is some</i><span /><i> sample</i> test text</b>\r
+ * // <b>This <i>is some<span /> sample</i> test text</b>\r
+ * // If "element" is <span /> and "parent" is <i>:\r
+ * // <b>This <i>is some</i><span /><i> sample</i> test text</b>\r
* element.breakParent( parent );\r
* @example\r
* // Before breaking:\r
- * // <b>This <i>is some<span /> sample</i> test text</b>\r
- * // If "element" is <span /> and "parent" is <b>:\r
- * // <b>This <i>is some</i></b><span /><b><i> sample</i> test text</b>\r
+ * // <b>This <i>is some<span /> sample</i> test text</b>\r
+ * // If "element" is <span /> and "parent" is <b>:\r
+ * // <b>This <i>is some</i></b><span /><b><i> sample</i> test text</b>\r
* element.breakParent( parent );\r
*/\r
breakParent : function( parent )\r
*/\r
getHtml : function()\r
{\r
- return this.$.innerHTML;\r
+ var retval = this.$.innerHTML;\r
+ // Strip <?xml:namespace> tags in IE. (#3341).\r
+ return CKEDITOR.env.ie ? retval.replace( /<\?[^>]*>/g, '' ) : retval;\r
},\r
\r
getOuterHtml : function()\r
}\r
\r
return (\r
- /** @ignore */\r
this.getName = function()\r
{\r
return nodeName;\r
\r
removeAttributes : function ( attributes )\r
{\r
- for ( var i = 0 ; i < attributes.length ; i++ )\r
- this.removeAttribute( attributes[ i ] );\r
+ if ( CKEDITOR.tools.isArray( attributes ) )\r
+ {\r
+ for ( var i = 0 ; i < attributes.length ; i++ )\r
+ this.removeAttribute( attributes[ i ] );\r
+ }\r
+ else\r
+ {\r
+ for ( var attr in attributes )\r
+ attributes.hasOwnProperty( attr ) && this.removeAttribute( attr );\r
+ }\r
},\r
\r
/**\r
if ( attrName in skipAttributes )\r
continue;\r
\r
- if( attrName == 'checked' && ( attrValue = this.getAttribute( attrName ) ) )\r
+ if ( attrName == 'checked' && ( attrValue = this.getAttribute( attrName ) ) )\r
dest.setAttribute( attrName, attrValue );\r
// IE BUG: value attribute is never specified even if it exists.\r
else if ( attribute.specified ||\r