Changeset 1691

Show
Ignore:
Timestamp:
2008-03-14 07:15:00 (4 months ago)
Author:
martinkou
Message:

Fixed #1955, #1981, #1985, #1989: Fixed XHTML source formatting errors in non-IE browsers.

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

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

    r1629 r1691  
    121121                        // Originaly, we were had the following here: 
    122122                        // return document.implementation.createDocument( '', '', null ) ; 
    123                         // 
    124                         // But, when manipulating document.domain (#123), we had 
    125                         // "Permission denied" errors when trying to call methods inside 
    126                         // the returned object. To avoid it, we have to change to the 
    127                         // following, by implementing a "custom" DOM document object, which 
    128                         // includes the methods that are useful for us. 
    129  
    130                         var domDoc = document.createDocumentFragment() ; 
    131  
    132                         domDoc.createElement = function( name ) 
    133                         { 
    134                                 return document.createElement( name ) ; 
    135                         } 
    136  
    137                         domDoc.createTextNode = function( text ) 
    138                         { 
    139                                 return document.createTextNode( text ) ; 
    140                         } 
    141  
    142                         domDoc.createAttribute = function( attName ) 
    143                         { 
    144                                 return document.createAttribute( attName ) ; 
    145                         } 
    146  
    147                         domDoc.createComment = function( text ) 
    148                         { 
    149                                 return document.createComment( text ) ; 
    150                         } 
    151  
    152                         return domDoc ; 
     123                        // But that doesn't work if we're running under domain relaxation mode, so we need a workaround. 
     124                        // See http://ajaxian.com/archives/xml-messages-with-cross-domain-json about the trick we're using. 
     125                        var doc = ( new DOMParser() ).parseFromString( '<tmp></tmp>', 'text/xml' ) ; 
     126                        FCKDomTools.RemoveNode( doc.firstChild ) ; 
     127                        return doc ; 
    153128        } 
    154129        return null ; 
  • FCKeditor/trunk/editor/_source/internals/fckxhtml_gecko.js

    r1565 r1691  
    2525FCKXHtml._GetMainXmlString = function() 
    2626{ 
    27         return '<xhtml>' + this.MainNode.innerHTML + '</xhtml>' ; 
     27        return ( new XMLSerializer() ).serializeToString( this.MainNode ) ; 
    2828} 
    2929 
  • FCKeditor/trunk/_whatsnew.html

    r1689 r1691  
    6161                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1920">#1920</a>] Fixed SSL 
    6262                        warning message when opening image and flash dialogs under HTTPS in IE6.</li> 
     63                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1955">#1955</a>] 
     64                        [<a target="_blank" href="http://dev.fckeditor.net/ticket/1981">#1981</a>]  
     65                        [<a target="_blank" href="http://dev.fckeditor.net/ticket/1985">#1985</a>]  
     66                        [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]  
     67                        Fixed XHTML source formatting errors in non-IE browsers.</li> 
    6368        </ul> 
    6469        <h3>