From: Timo Tijhof Date: Tue, 4 Aug 2015 23:07:45 +0000 (-0700) Subject: resourceloader: Fix RLQ script to support IE8 quirk X-Git-Tag: 1.31.0-rc.0~10517^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=7facd8b214d36ddd3105bb5ee0e56f6ec17beba1;p=lhc%2Fweb%2Fwiklou.git resourceloader: Fix RLQ script to support IE8 quirk In IE8 there is a race condition. If the window.RLQ runs first (that is, the startup module loads first) then 'var RLQ' does not get associated properly to our custom window.RLQ object. The other way around is fine, but never happens because " ); } diff --git a/resources/src/startup.js b/resources/src/startup.js index d4cfa0221e..3b79bd39d0 100644 --- a/resources/src/startup.js +++ b/resources/src/startup.js @@ -84,7 +84,7 @@ function startUp() { while ( RLQ.length ) { RLQ.shift()(); } - RLQ = { + window.RLQ = { push: function ( fn ) { fn(); } diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 6a25d8b2ec..4b903726d2 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -141,7 +141,7 @@ class OutputPageTest extends MediaWikiTestCase { // Load module script only array( array( 'test.foo', ResourceLoaderModule::TYPE_SCRIPTS ), - "" ), @@ -160,14 +160,14 @@ class OutputPageTest extends MediaWikiTestCase { // Load private module (only=scripts) array( array( 'test.quux', ResourceLoaderModule::TYPE_SCRIPTS ), - "" ), // Load private module (combined) array( array( 'test.quux', ResourceLoaderModule::TYPE_COMBINED ), - "" @@ -185,10 +185,10 @@ class OutputPageTest extends MediaWikiTestCase { // Load two modules in separate groups array( array( array( 'test.group.foo', 'test.group.bar' ), ResourceLoaderModule::TYPE_COMBINED ), - "\n" - . "" ),