Ticket #5018: 5018_4.patch

File 5018_4.patch, 2.4 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/styles/plugin.js

     
    937937                for ( var attName in attributes )
    938938                {
    939939                        // The 'class' element value must match (#1318).
    940                         if ( attName == 'class' && element.getAttribute( attName ) != attributes[ attName ] )
     940                        if ( ( attName == 'class' || style._.definition.fullMatch )
     941                                && element.getAttribute( attName ) != normalizeProperty( attName, attributes[ attName ] ) )
    941942                                continue;
    942943                        removeEmpty = element.hasAttribute( attName );
    943944                        element.removeAttribute( attName );
     
    945946
    946947                for ( var styleName in styles )
    947948                {
     949                        // Full match style insist on having fully equivalence. (#5018)
     950                        if ( style._.definition.fullMatch
     951                                && element.getStyle( styleName ) != normalizeProperty( styleName, styles[ styleName ], true ) )
     952                                continue;
     953
    948954                        removeEmpty = removeEmpty || !!element.getStyle( styleName );
    949955                        element.removeStyle( styleName );
    950956                }
     
    12091215                return overrides;
    12101216        }
    12111217
     1218        function normalizeProperty( name, value, isStyle )
     1219        {
     1220                var temp = new CKEDITOR.dom.element( 'span' );
     1221                temp [ isStyle ? 'setStyle' : 'setAttribute' ]( name, value );
     1222                return temp[ isStyle ? 'getStyle' : 'getAttribute' ]( name );
     1223        }
     1224       
    12121225        function normalizeCssText( unparsedCssText, nativeNormalize )
    12131226        {
    12141227                var styleText;
  • _source/plugins/find/dialogs/find.js

     
    6767
    6868        var findDialog = function( editor, startupPage )
    6969        {
    70                 // Style object for highlights.
    71                 var highlightStyle = new CKEDITOR.style( editor.config.find_highlight );
     70                // Style object for highlights: (#5018)
     71                // 1. Defined as full match style to avoid compromising ordinary text color styles.
     72                // 2. Must be apply onto inner-most text to avoid conflicting with ordinary text color styles visually.
     73                var highlightStyle = new CKEDITOR.style( CKEDITOR.tools.extend( { fullMatch : true, childRule : function(){ return false; } },
     74                        editor.config.find_highlight ) );
    7275
    7376                /**
    7477                 * Iterator which walk through the specified range char by char. By
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy