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