X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fdom%2Fdocument.js;fp=_source%2Fcore%2Fdom%2Fdocument.js;h=1435fbdd627fd7c043a6ad5a5cecff0bebb760ba;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hp=a68ddf5394201c13f289c4f656786042c08b77ec;hpb=614511639979907ceb0da3614122a4d8eb963ad4;p=ckeditor.git diff --git a/_source/core/dom/document.js b/_source/core/dom/document.js index a68ddf5..1435fbd 100644 --- a/_source/core/dom/document.js +++ b/_source/core/dom/document.js @@ -165,6 +165,9 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, getHead : function() { var head = this.$.getElementsByTagName( 'head' )[0]; + if ( !head ) + head = this.getDocumentElement().append( new CKEDITOR.dom.element( 'head' ), true ); + else head = new CKEDITOR.dom.element( head ); return ( @@ -220,5 +223,29 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, { return win; })(); + }, + + /** + * Defines the document contents through document.write. Note that the + * previous document contents will be lost (cleaned). + * @since 3.5 + * @param {String} html The HTML defining the document contents. + * @example + * document.write( + * '<html>' + + * '<head><title>Sample Doc</title></head>' + + * '<body>Document contents created by code</body>' + + * '</html>' ); + */ + write : function( html ) + { + // Don't leave any history log in IE. (#5657) + this.$.open( 'text/html', 'replace' ); + + // Support for custom document.domain in IE. + CKEDITOR.env.isCustomDomain() && ( this.$.domain = document.domain ); + + this.$.write( html ); + this.$.close(); } });