Changeset 927

Show
Ignore:
Timestamp:
2007-10-01 11:27:58 (14 months ago)
Author:
fredck
Message:

Fixed #1318 : The "class" attribute is now treated differently. It is now used to identify different elements, in combination with the element name (similar element = A.nodeName == B.nodeName && A.className == B.className).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/classes/fckstyle.js

    r896 r927  
    183183                                if ( this.CheckElementRemovable( pathElement ) ) 
    184184                                { 
    185                                         if ( isBoundary  
    186                                                 && !FCKDomTools.CheckIsEmptyElement( pathElement,  
    187                                                                 function( el )  
    188                                                                 {  
    189                                                                         return ( el != bookmarkStart ) ;  
    190                                                                 } )  
     185                                        if ( isBoundary 
     186                                                && !FCKDomTools.CheckIsEmptyElement( pathElement, 
     187                                                                function( el ) 
     188                                                                { 
     189                                                                        return ( el != bookmarkStart ) ; 
     190                                                                } ) 
    191191                                                ) 
    192192                                        { 
    193193                                                lastBoundaryElement = pathElement ; 
    194                                                  
     194 
    195195                                                // We'll be continuously including elements in the 
    196196                                                // boundaryElements array, but only those added before 
     
    211211                                                                if ( FCKDomTools.HasAttribute( pathElement, att ) ) 
    212212                                                                { 
    213                                                                         if ( att == 'style' ) 
    214                                                                                 this._RemoveStylesFromElement( pathElement ) ; 
    215                                                                         else 
    216                                                                                 FCKDomTools.RemoveAttribute( pathElement, att ) ; 
     213                                                                        switch ( att ) 
     214                                                                        { 
     215                                                                                case 'style' : 
     216                                                                                        this._RemoveStylesFromElement( pathElement ) ; 
     217                                                                                        break ; 
     218 
     219                                                                                case 'class' : 
     220                                                                                        // The 'class' element value must match (#1318). 
     221                                                                                        if ( FCKDomTools.GetAttributeValue( pathElement, att ) != this.GetFinalAttributeValue( att ) ) 
     222                                                                                                continue ; 
     223 
     224                                                                                default : 
     225                                                                                        FCKDomTools.RemoveAttribute( pathElement, att ) ; 
     226                                                                        } 
    217227                                                                } 
    218228                                                        } 
     
    349359                                                if ( FCKDomTools.HasAttribute( currentNode, att ) ) 
    350360                                                { 
    351                                                         if ( att == 'style' ) 
    352                                                                 this._RemoveStylesFromElement( currentNode ) ; 
    353                                                         else 
    354                                                                 FCKDomTools.RemoveAttribute( currentNode, att ) ; 
     361                                                        switch ( att ) 
     362                                                        { 
     363                                                                case 'style' : 
     364                                                                        this._RemoveStylesFromElement( currentNode ) ; 
     365                                                                        break ; 
     366 
     367                                                                case 'class' : 
     368                                                                        // The 'class' element value must match (#1318). 
     369                                                                        if ( FCKDomTools.GetAttributeValue( currentNode, att ) != this.GetFinalAttributeValue( att ) ) 
     370                                                                                continue ; 
     371 
     372                                                                default : 
     373                                                                        FCKDomTools.RemoveAttribute( currentNode, att ) ; 
     374                                                        } 
    355375                                                } 
    356376                                        } 
     
    509529                                if ( FCKDomTools.HasAttribute( innerElement, att ) ) 
    510530                                { 
    511                                         if ( att == 'style' ) 
    512                                                 this._RemoveStylesFromElement( innerElement ) ; 
    513                                         else 
    514                                                 FCKDomTools.RemoveAttribute( innerElement, att ) ; 
     531                                        switch ( att ) 
     532                                        { 
     533                                                case 'style' : 
     534                                                        this._RemoveStylesFromElement( innerElement ) ; 
     535                                                        break ; 
     536 
     537                                                case 'class' : 
     538                                                        // The 'class' element value must match (#1318). 
     539                                                        if ( FCKDomTools.GetAttributeValue( innerElement, att ) != this.GetFinalAttributeValue( att ) ) 
     540                                                                continue ; 
     541 
     542                                                default : 
     543                                                        FCKDomTools.RemoveAttribute( innerElement, att ) ; 
     544                                        } 
    515545                                } 
    516546                        }