* alert( CKEDITOR.tools.cssStyleToDomStyle( 'background-color' ) ); // "backgroundColor"\r
* alert( CKEDITOR.tools.cssStyleToDomStyle( 'float' ) ); // "cssFloat"\r
*/\r
- cssStyleToDomStyle : function( cssName )\r
+ cssStyleToDomStyle : ( function()\r
{\r
- if ( cssName == 'float' )\r
- return 'cssFloat';\r
- else\r
+ var test = document.createElement( 'div' ).style;\r
+\r
+ var cssFloat = ( typeof test.cssFloat != 'undefined' ) ? 'cssFloat'\r
+ : ( typeof test.styleFloat != 'undefined' ) ? 'styleFloat'\r
+ : 'float';\r
+\r
+ return function( cssName )\r
{\r
- return cssName.replace( /-./g, function( match )\r
- {\r
- return match.substr( 1 ).toUpperCase();\r
- });\r
- }\r
- },\r
+ if ( cssName == 'float' )\r
+ return cssFloat;\r
+ else\r
+ {\r
+ return cssName.replace( /-./g, function( match )\r
+ {\r
+ return match.substr( 1 ).toUpperCase();\r
+ });\r
+ }\r
+ };\r
+ } )(),\r
\r
/**\r
* Replace special HTML characters in a string with their relative HTML\r