X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fdom%2Fdocument.js;h=a68ddf5394201c13f289c4f656786042c08b77ec;hb=614511639979907ceb0da3614122a4d8eb963ad4;hp=dd0f9a0f9b57aa3ad96aeb9b087a17af36e5b0d2;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/core/dom/document.js b/_source/core/dom/document.js index dd0f9a0..a68ddf5 100644 --- a/_source/core/dom/document.js +++ b/_source/core/dom/document.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -52,6 +52,21 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, } }, + appendStyleText : function( cssStyleText ) + { + if ( this.$.createStyleSheet ) + { + var styleSheet = this.$.createStyleSheet( "" ); + styleSheet.cssText = cssStyleText ; + } + else + { + var style = new CKEDITOR.dom.element( 'style', this ); + style.append( new CKEDITOR.dom.text( cssStyleText, this ) ); + this.getHead().append( style ); + } + }, + createElement : function( name, attribsAndStyles ) { var element = new CKEDITOR.dom.element( name, this ); @@ -135,7 +150,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, getElementsByTag : function( tagName, namespace ) { - if ( !CKEDITOR.env.ie && namespace ) + if ( !( CKEDITOR.env.ie && ! ( document.documentMode > 8 ) ) && namespace ) tagName = namespace + ':' + tagName; return new CKEDITOR.dom.nodeList( this.$.getElementsByTagName( tagName ) ); }, @@ -153,7 +168,6 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, head = new CKEDITOR.dom.element( head ); return ( - /** @ignore */ this.getHead = function() { return head; @@ -172,19 +186,21 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, var body = new CKEDITOR.dom.element( this.$.body ); return ( - /** @ignore */ this.getBody = function() { return body; })(); }, + /** + * Gets the DOM document element for this document. + * @returns {CKEDITOR.dom.element} The DOM document element. + */ getDocumentElement : function() { var documentElement = new CKEDITOR.dom.element( this.$.documentElement ); return ( - /** @ignore */ this.getDocumentElement = function() { return documentElement; @@ -194,14 +210,12 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, /** * Gets the window object that holds this document. * @returns {CKEDITOR.dom.window} The window object. - * @example */ getWindow : function() { var win = new CKEDITOR.dom.window( this.$.parentWindow || this.$.defaultView ); return ( - /** @ignore */ this.getWindow = function() { return win;