X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Ftools.js;h=6f9542869acf7288049bcb804fe2f28143eaecaf;hp=29b34b4bfb27e1b5197664511b47e54a20a59b7d;hb=8761695d9b70afe75905deaac88f78c1f8aeb32d;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91 diff --git a/_source/core/tools.js b/_source/core/tools.js index 29b34b4..6f95428 100644 --- a/_source/core/tools.js +++ b/_source/core/tools.js @@ -197,18 +197,27 @@ For licensing, see LICENSE.html or http://ckeditor.com/license * alert( CKEDITOR.tools.cssStyleToDomStyle( 'background-color' ) ); // "backgroundColor" * alert( CKEDITOR.tools.cssStyleToDomStyle( 'float' ) ); // "cssFloat" */ - cssStyleToDomStyle : function( cssName ) + cssStyleToDomStyle : ( function() { - if ( cssName == 'float' ) - return 'cssFloat'; - else + var test = document.createElement( 'div' ).style; + + var cssFloat = ( typeof test.cssFloat != 'undefined' ) ? 'cssFloat' + : ( typeof test.styleFloat != 'undefined' ) ? 'styleFloat' + : 'float'; + + return function( cssName ) { - return cssName.replace( /-./g, function( match ) - { - return match.substr( 1 ).toUpperCase(); - }); - } - }, + if ( cssName == 'float' ) + return cssFloat; + else + { + return cssName.replace( /-./g, function( match ) + { + return match.substr( 1 ).toUpperCase(); + }); + } + }; + } )(), /** * Replace special HTML characters in a string with their relative HTML