Ticket #5242: 5242_2.patch

File 5242_2.patch, 1.4 KB (added by garry.yao, 2 years ago)
  • _source/plugins/styles/plugin.js

     
    312312                stylesDef = styleDefinition.styles; 
    313313 
    314314                // Builds the StyleText. 
     315                var stylesText = ( styleDefinition.attributes && styleDefinition.attributes[ 'style' ] ) || '', 
     316                                specialStylesText = ''; 
    315317 
    316                 var stylesText = ( styleDefinition.attributes && styleDefinition.attributes[ 'style' ] ) || ''; 
    317  
    318318                if ( stylesText.length ) 
    319319                        stylesText = stylesText.replace( semicolonFixRegex, ';' ); 
    320320 
    321321                for ( var style in stylesDef ) 
    322                         stylesText += ( style + ':' + stylesDef[ style ] ).replace( semicolonFixRegex, ';' ); 
     322                { 
     323                        var styleVal = stylesDef[ style ], 
     324                                        stylesText = ( style + ':' + styleVal ).replace( semicolonFixRegex, ';' ); 
    323325 
     326                        // Some browsers don't support 'inheirt' property value, leave them intact. (#5242) 
     327                        if ( styleVal == 'inherit' ) 
     328                                specialStylesText += stylesText; 
     329                        else 
     330                                stylesText += stylesText; 
     331                } 
     332 
    324333                // Browsers make some changes to the style when applying them. So, here 
    325334                // we normalize it to the browser format. 
    326335                if ( stylesText.length ) 
    327336                        stylesText = normalizeCssText( stylesText ); 
    328337 
     338                stylesText += specialStylesText; 
     339 
    329340                // Return it, saving it to the next request. 
    330341                return ( styleDefinition._ST = stylesText ); 
    331342        }; 
© 2003 – 2011 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy