Changeset 1218 for FCKeditor/trunk


Ignore:
Timestamp:
12/18/07 11:31:52 (8 years ago)
Author:
fredck
Message:

Fixed #1603 : Certain specific markup was making FCKeditor entering in a loop, blocking its execution. Now, div elements are considered block elements only if they are not "containers", containing other block elements.

Location:
FCKeditor/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/_whatsnew.html

    r1211 r1218  
    6060                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1643">#1643</a>] Resolved
    6161                        several "strict warning" messages in Firefox when running FCKeditor.</li>
     62                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1603">#1603</a>] Certain
     63                        specific markup was making FCKeditor entering in a loop, blocking its execution.</li>
    6264        </ul>
    6365        <p>
  • FCKeditor/trunk/editor/_source/classes/fckdomrangeiterator.js

    r1090 r1218  
    126126                                        }
    127127
     128                                        // The range must finish right before the boundary,
     129                                        // including possibly skipped empty spaces. (#1603)
     130                                        if ( range )
     131                                                range.SetEnd( currentNode, 3, true ) ;
     132
    128133                                        closeRange = true ;
    129134                                }
     
    182187
    183188                                        currentNode = parentNode ;
     189                                        includeNode = true ;
    184190                                        isLast = ( currentNode == lastNode ) ;
    185191                                        continueFromSibling = true ;
  • FCKeditor/trunk/editor/_source/classes/fckelementpath.js

    r988 r1218  
    4747                                if ( FCKListsLib.PathBlockLimitElements[ sElementName ] != null )
    4848                                {
    49                                         // DIV is considered the Block, if no block is available (#525).
    50                                         if ( !eBlock && sElementName == 'div' )
     49                                        // DIV is considered the Block, if no block is available (#525)
     50                                        // and if it doesn't contain other blocks.
     51                                        if ( !eBlock && sElementName == 'div' && !FCKElementPath._CheckHasBlock( e ) )
    5152                                                eBlock = e ;
    5253                                        else
     
    6869}
    6970
     71/**
     72 * Check if an element contains any block element.
     73 */
     74FCKElementPath._CheckHasBlock = function( element )
     75{
     76        var childNodes = element.childNodes ;
     77       
     78        for ( var i = 0, count = childNodes.length ; i < count ; i++ )
     79        {
     80                var child = childNodes[i] ;
     81               
     82                if ( child.nodeType == 1 && FCKListsLib.BlockElements[ child.nodeName.toLowerCase() ] )
     83                        return true ;
     84        }
     85       
     86        return false ;
     87}
    7088
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2015 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy