- 'class' : className,\r
- src : CKEDITOR.getUrl( 'images/spacer.gif' ),\r
- 'data-cke-realelement' : encodeURIComponent( html ),\r
- 'data-cke-real-node-type' : realElement.type,\r
- alt : label,\r
- title : label,\r
- align : realElement.attributes.align || ''\r
+ var lang = this.lang.fakeobjects,\r
+ label = lang[ realElementType ] || lang.unknown,\r
+ html;\r
+\r
+ var writer = new CKEDITOR.htmlParser.basicWriter();\r
+ realElement.writeHtml( writer );\r
+ html = writer.getHtml();\r
+\r
+ var attributes =\r
+ {\r
+ 'class' : className,\r
+ 'data-cke-realelement' : encodeURIComponent( html ),\r
+ 'data-cke-real-node-type' : realElement.type,\r
+ alt : label,\r
+ title : label,\r
+ align : realElement.attributes.align || ''\r
+ };\r
+\r
+ // Do not set "src" on high-contrast so the alt text is displayed. (#8945)\r
+ if ( !CKEDITOR.env.hc )\r
+ attributes.src = CKEDITOR.getUrl( 'images/spacer.gif' );\r
+\r
+ if ( realElementType )\r
+ attributes[ 'data-cke-real-element-type' ] = realElementType;\r
+\r
+ if ( isResizable )\r
+ {\r
+ attributes[ 'data-cke-resizable' ] = isResizable;\r
+ var realAttrs = realElement.attributes,\r
+ fakeStyle = new cssStyle();\r
+\r
+ var width = realAttrs.width,\r
+ height = realAttrs.height;\r
+\r
+ width != undefined && ( fakeStyle.rules.width = cssLength( width ) );\r
+ height != undefined && ( fakeStyle.rules.height = cssLength ( height ) );\r
+ fakeStyle.populate( attributes );\r
+ }\r
+\r
+ return new CKEDITOR.htmlParser.element( 'img', attributes );\r