/*\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
if ( attName == '_length' )\r
continue;\r
\r
- var elementAttr = element.getAttribute( attName );\r
- if ( attribs[attName] ==\r
+ var elementAttr = element.getAttribute( attName ) || '';\r
+ if ( attribs[ attName ] ==\r
( attName == 'style' ?\r
normalizeCssText( elementAttr, false ) : elementAttr ) )\r
{\r
stylesText = stylesText.replace( semicolonFixRegex, ';' );\r
\r
for ( var style in stylesDef )\r
- stylesText += style + ':' + stylesDef[ style ] + ';';\r
+ stylesText += ( style + ':' + stylesDef[ style ] ).replace( semicolonFixRegex, ';' );\r
\r
// Browsers make some changes to the style when applying them. So, here\r
// we normalize it to the browser format.\r
// Compensate tail semi-colon.\r
return styleText.replace( /\s*([;:])\s*/, '$1' )\r
.replace( /([^\s;])$/, '$1;')\r
+ .replace( /,\s+/g, ',' ) // Trimming spaces after comma (e.g. font-family name)(#4107).\r
.toLowerCase();\r
}\r
\r