Follow-up to bug #15858: htlmArea RTE: Stylesheet access error in Google Chrome 7
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 5 Oct 2010 04:13:39 +0000 (04:13 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 5 Oct 2010 04:13:39 +0000 (04:13 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@8948 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index ca7ec6d..4ec697e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-05  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Follow-up to bug #15858: htlmArea RTE: Stylesheet access error in Google Chrome 7
+
 2010-10-03  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #15884: htmlArea RTE: Remove class Ext.ux.StatusBar
index 3e56d56..af0d33c 100644 (file)
@@ -1,3 +1,7 @@
+2010-10-05  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Follow-up to bug #15858: htlmArea RTE: Stylesheet access error in Google Chrome 7
+
 2010-10-03  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #15884: htmlArea RTE: Remove class Ext.ux.StatusBar
index e4fd513..aa633a3 100644 (file)
@@ -968,20 +968,35 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
                } else {
                                // Test if the styleSheets array is at all accessible
                        if (Ext.isIE) {
-                               try { rules = this.document.styleSheets[0].rules; } catch(e) { stylesAreLoaded = false; errorText = e; }
+                               try { 
+                                       rules = this.document.styleSheets[0].rules;
+                               } catch(e) {
+                                       stylesAreLoaded = false;
+                                       errorText = e;
+                               }
                        } else {
-                               try { this.document.styleSheets[0] && this.document.styleSheets[0].cssRules; } catch(e) { stylesAreLoaded = false; errorText = e; }
+                               try { 
+                                       this.document.styleSheets && this.document.styleSheets[0] && this.document.styleSheets[0].rules;
+                               } catch(e) {
+                                       stylesAreLoaded = false;
+                                       errorText = e;
+                               }
                        }
                                // Then test if all stylesheets are accessible
                        if (stylesAreLoaded) {
-                               Ext.each(this.document.styleSheets, function (styleSheet) {
-                                       if (Ext.isIE) {
-                                               try { rules = styleSheet.rules; } catch(e) { stylesAreLoaded = false; errorText = e; return false; }
-                                               try { rules = styleSheet.imports; } catch(e) { stylesAreLoaded = false; errorText = e; return false; }
-                                       } else {
-                                               try { rules = styleSheet.cssRules; } catch(e) { stylesAreLoaded = false; errorText = e; return false; }
-                                       }
-                               });
+                               if (this.document.styleSheets.length) {
+                                       Ext.each(this.document.styleSheets, function (styleSheet) {
+                                               if (Ext.isIE) {
+                                                       try { rules = styleSheet.rules; } catch(e) { stylesAreLoaded = false; errorText = e; return false; }
+                                                       try { rules = styleSheet.imports; } catch(e) { stylesAreLoaded = false; errorText = e; return false; }
+                                               } else {
+                                                       try { rules = styleSheet.cssRules; } catch(e) { stylesAreLoaded = false; errorText = e; return false; }
+                                               }
+                                       });
+                               } else {
+                                       stylesAreLoaded = false;
+                                       errorText = 'Empty stylesheets array';
+                               }
                        }
                }
                if (!stylesAreLoaded) {
@@ -2063,7 +2078,7 @@ HTMLArea.Editor = Ext.extend(Ext.util.Observable, {
                                                id: this.editorId + '-iframe',
                                                tag: 'iframe',
                                                cls: 'editorIframe',
-                                               src: Ext.isGecko ? 'javascript:void(0);' : HTMLArea.editorUrl + 'popups/blank.html'
+                                               src: (Ext.isGecko || Ext.isChrome) ? 'javascript:void(0);' : HTMLArea.editorUrl + 'popups/blank.html'
                                        },
                                        isNested: this.isNested,
                                        nestedParentElements: this.nestedParentElements,