JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1
[ckeditor.git] / _source / core / dom / document.js
index dd0f9a0..e1026c1 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