[BUGFIX] htmlArea RTE: CSS class names are lowercase in WebKit
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 21 Jan 2012 06:24:39 +0000 (01:24 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 10 Feb 2012 00:52:37 +0000 (01:52 +0100)
Problem: See https://bugs.webkit.org/show_bug.cgi?id=55619
Solution: Add doctype to the iframe source

Change-Id: Iec721ee4e6eef990327f1398e02acdd35e89d689
Resolves: #32408
Releases: 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/8623
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index 4561599..5482357 100644 (file)
@@ -139,6 +139,7 @@ HTMLArea.Config = function (editorId) {
        this.documentType = '<!DOCTYPE html\r'
                        + '    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r'
                        + '    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r';
+       this.blankDocument = '<html><head></head><body></body></html>';
                // Hold the configuration of buttons and hot keys registered by plugins
        this.buttonsConfig = {};
        this.hotKeyList = {};
@@ -1003,7 +1004,7 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
                                        errorText = e;
                                }
                        } else {
-                               try { 
+                               try {
                                        this.document.styleSheets && this.document.styleSheets[0] && this.document.styleSheets[0].rules;
                                } catch(e) {
                                        stylesAreLoaded = false;
@@ -2191,7 +2192,7 @@ HTMLArea.Editor = Ext.extend(Ext.util.Observable, {
                                                id: this.editorId + '-iframe',
                                                tag: 'iframe',
                                                cls: 'editorIframe',
-                                               src: (Ext.isGecko || Ext.isWebKit) ? 'javascript:void(0);' : HTMLArea.editorUrl + 'popups/blank.html'
+                                               src: Ext.isGecko ? 'javascript:void(0);' : (Ext.isWebKit ? 'javascript: \'' + HTMLArea.htmlEncode(this.config.documentType + this.config.blankDocument) + '\'' : HTMLArea.editorUrl + 'popups/blank.html')
                                        },
                                        isNested: this.isNested,
                                        nestedParentElements: this.nestedParentElements,