[BUGFIX] RTE: Parsing of some style sheets may fail in IE on first load 56/36656/2
authorStanislas Rolland <typo3@sjbr.ca>
Wed, 4 Feb 2015 15:58:18 +0000 (10:58 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Wed, 4 Feb 2015 16:00:40 +0000 (17:00 +0100)
The length of the style sheet's rules array is reported as 0 while,
in fact, the style sheet is not yet completely loaded.

Releases: master
Resolves: #64854
Change-Id: I406ddebb250c15cd5b04ae1b734f146bd1025863
Reviewed-on: http://review.typo3.org/36656
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/CSS/Parser.js

index b4e5651..fcf9aa4 100644 (file)
@@ -167,7 +167,13 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/CSS/Parser',
                                for (var index = 0, n = styleSheets.length; index < n; index++) {
                                        try {
                                                var styleSheet = styleSheets[index];
-                                               this.parseRules(styleSheet.cssRules);
+                                               if (!UserAgent.isIE || styleSheet.cssRules.length) {
+                                                       this.parseRules(styleSheet.cssRules);
+                                               } else {
+                                                       this.cssLoaded = false;
+                                                       this.parsedClasses = {};
+                                                       break;
+                                               }
                                        } catch (e) {
                                                this.error = e;
                                                this.cssLoaded = false;