JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.3
[ckeditor.git] / _source / core / dom / document.js
index dd0f9a0..a68ddf5 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -52,6 +52,21 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype,
                        }\r
                },\r
 \r
+               appendStyleText : function( cssStyleText )\r
+               {\r
+                       if ( this.$.createStyleSheet )\r
+                       {\r
+                               var styleSheet = this.$.createStyleSheet( "" );\r
+                               styleSheet.cssText = cssStyleText ;\r
+                       }\r
+                       else\r
+                       {\r
+                               var style = new CKEDITOR.dom.element( 'style', this );\r
+                               style.append( new CKEDITOR.dom.text( cssStyleText, this ) );\r
+                               this.getHead().append( style );\r
+                       }\r
+               },\r
+\r
                createElement : function( name, attribsAndStyles )\r
                {\r
                        var element = new CKEDITOR.dom.element( name, this );\r
@@ -135,7 +150,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype,
 \r
                getElementsByTag : function( tagName, namespace )\r
                {\r
-                       if ( !CKEDITOR.env.ie && namespace )\r
+                       if ( !( CKEDITOR.env.ie && ! ( document.documentMode > 8 ) ) && namespace )\r
                                tagName = namespace + ':' + tagName;\r
                        return new CKEDITOR.dom.nodeList( this.$.getElementsByTagName( tagName ) );\r
                },\r
@@ -153,7 +168,6 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype,
                        head = new CKEDITOR.dom.element( head );\r
 \r
                        return (\r
-                       /** @ignore */\r
                        this.getHead = function()\r
                                {\r
                                        return head;\r
@@ -172,19 +186,21 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype,
                        var body = new CKEDITOR.dom.element( this.$.body );\r
 \r
                        return (\r
-                       /** @ignore */\r
                        this.getBody = function()\r
                                {\r
                                        return body;\r
                                })();\r
                },\r
 \r
+               /**\r
+                * Gets the DOM document element for this document.\r
+                * @returns {CKEDITOR.dom.element} The DOM document element.\r
+                */\r
                getDocumentElement : function()\r
                {\r
                        var documentElement = new CKEDITOR.dom.element( this.$.documentElement );\r
 \r
                        return (\r
-                       /** @ignore */\r
                        this.getDocumentElement = function()\r
                                {\r
                                        return documentElement;\r
@@ -194,14 +210,12 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype,
                /**\r
                 * Gets the window object that holds this document.\r
                 * @returns {CKEDITOR.dom.window} The window object.\r
-                * @example\r
                 */\r
                getWindow : function()\r
                {\r
                        var win = new CKEDITOR.dom.window( this.$.parentWindow || this.$.defaultView );\r
 \r
                        return (\r
-                       /** @ignore */\r
                        this.getWindow = function()\r
                                {\r
                                        return win;\r