Changeset 256

Show
Ignore:
Timestamp:
2007-04-17 12:05:01 (19 months ago)
Author:
fredck
Message:

Fixed #325 : GetXHTML should not make changes to the DOM tree.

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fckdomtools.js

    r253 r256  
    7979                                        { 
    8080                                                node.removeChild( eChildNode ) ; 
    81  
    82                                                 // If the node now is empty then append a   to visually keep the same appearance (#325) 
    83                                                 if ( node.lastChild === null && FCKConfig.FillEmptyBlocks ) 
    84                                                         node.appendChild( FCKTools.GetElementDocument( node ).createTextNode( String.fromCharCode(160) ) ); 
    8581                                                continue ; 
    8682                                        } 
  • FCKeditor/trunk/editor/_source/internals/fckxhtml.js

    r189 r256  
    124124FCKXHtml._AppendChildNodes = function( xmlNode, htmlNode, isBlockElement ) 
    125125{ 
     126        var oNode = htmlNode.firstChild ; 
     127 
     128        while ( oNode ) 
     129        { 
     130                this._AppendNode( xmlNode, oNode ) ; 
     131                oNode = oNode.nextSibling ; 
     132        } 
     133 
    126134        // Trim block elements. This is also needed to avoid Firefox leaving extra 
    127135        // BRs at the end of them. 
    128136        if ( isBlockElement ) 
    129                 FCKDomTools.TrimNode( htmlNode, true ) ; 
    130  
    131         var iCount = 0 ; 
    132  
    133         var oNode = htmlNode.firstChild ; 
    134  
    135         while ( oNode ) 
    136         { 
    137                 if ( this._AppendNode( xmlNode, oNode ) ) 
    138                         iCount++ ; 
    139  
    140                 oNode = oNode.nextSibling ; 
    141         } 
    142  
    143         if ( iCount == 0 ) 
     137                FCKDomTools.TrimNode( xmlNode, true ) ; 
     138 
     139        // If the resulting node is empty. 
     140        if ( xmlNode.childNodes.length == 0 ) 
    144141        { 
    145142                if ( isBlockElement && FCKConfig.FillEmptyBlocks ) 
  • FCKeditor/trunk/_whatsnew.html

    r255 r256  
    5353                        was being lost for images or comments only HTML inserted directly in the editor 
    5454                        source or loaded in the editor.</li> 
    55                 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/388">#388</a>] Creating links in 
    56                         lines separated by &lt;br&gt; in IE can lead to a merge of the links.</li> 
    57                 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/325">#325</a>] Calling the GetXHTML 
    58                         can distort visually the rendering in Firefox.</li> 
     55                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/388">#388</a>] Creating 
     56                        links in lines separated by &lt;br&gt; in IE can lead to a merge of the links.</li> 
     57                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/325">#325</a>] Calling 
     58                        the GetXHTML can distort visually the rendering in Firefox.</li> 
    5959        </ul> 
    6060        <h3>