Ticket #6957: 6957_2.patch

File 6957_2.patch, 3.3 KB (added by Garry Yao, 8 years ago)
  • _source/plugins/find/dialogs/find.js

     
    7171                // Style object for highlights: (#5018)
    7272                // 1. Defined as full match style to avoid compromising ordinary text color styles.
    7373                // 2. Must be apply onto inner-most text to avoid conflicting with ordinary text color styles visually.
    74                 var highlightStyle = new CKEDITOR.style( CKEDITOR.tools.extend( { fullMatch : true, childRule : function(){ return 0; } },
    75                         editor.config.find_highlight ) );
     74                var highlightStyle = new CKEDITOR.style(
     75                        CKEDITOR.tools.extend( { attributes : { 'data-cke-highlight': 1 }, fullMatch : 1, ignoreReadonly : 1, childRule : function(){ return 0; } },
     76                        editor.config.find_highlight, true ) );
    7677
    7778                /**
    7879                 * Iterator which walk through the specified range char by char. By
  • _source/plugins/styles/plugin.js

     
    222222                // current style definition.
    223223                checkElementRemovable : function( element, fullMatch )
    224224                {
    225                         if ( !element || element.isReadOnly() )
     225                        var def = this._.definition;
     226
     227                        if ( !element || !def.ignoreReadonly && element.isReadOnly() )
    226228                                return false;
    227229
    228                         var def = this._.definition,
    229                                 attribs,
     230                        var attribs,
    230231                                name = element.getName();
    231232
    232233                        // If the element name is the same as the style name.
     
    423424                var isUnknownElement;
    424425
    425426                // Indicates that fully selected read-only elements are to be included in the styling range.
    426                 var includeReadonly = def.includeReadonly;
     427                var ignoreReadonly = def.ignoreReadonly,
     428                        includeReadonly = ignoreReadonly || def.includeReadonly;
    427429
    428430                // If the read-only inclusion is not available in the definition, try
    429431                // to get it from the document data.
     
    447449
    448450                var styleRange;
    449451
    450                 // Check if the boundaries are inside non stylable elements.
    451                 var firstUnstylable = getUnstylableParent( firstNode ),
    452                         lastUnstylable = getUnstylableParent( lastNode );
     452                if ( !ignoreReadonly )
     453                {
     454                        // Check if the boundaries are inside non stylable elements.
     455                        var firstUnstylable = getUnstylableParent( firstNode ),
     456                                        lastUnstylable = getUnstylableParent( lastNode );
    453457
    454                 // If the first element can't be styled, we'll start processing right
    455                 // after its unstylable root.
    456                 if ( firstUnstylable )
    457                         currentNode = firstUnstylable.getNextSourceNode( true );
     458                        // If the first element can't be styled, we'll start processing right
     459                        // after its unstylable root.
     460                        if ( firstUnstylable )
     461                                currentNode = firstUnstylable.getNextSourceNode( true );
    458462
    459                 // If the last element can't be styled, we'll stop processing on its
    460                 // unstylable root.
    461                 if ( lastUnstylable )
    462                         lastNode = lastUnstylable;
     463                        // If the last element can't be styled, we'll stop processing on its
     464                        // unstylable root.
     465                        if ( lastUnstylable )
     466                                lastNode = lastUnstylable;
     467                }
    463468
    464469                // Do nothing if the current node now follows the last node to be processed.
    465470                if ( currentNode.getPosition( lastNode ) == CKEDITOR.POSITION_FOLLOWING )
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy