From: Timo Tijhof Date: Tue, 26 Mar 2013 17:59:07 +0000 (+0100) Subject: mw.loader: Guard against odd setTimeout behaviour in old Firefox X-Git-Tag: 1.31.0-rc.0~20202^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=a1d4f5b0a27752d31d7a7c3b6a7231fde3501696;p=lhc%2Fweb%2Fwiklou.git mw.loader: Guard against odd setTimeout behaviour in old Firefox Bug: 46575 Change-Id: I80af730daa815f0c273fe942c570d1f0144bbbb1 --- diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index 2ceb3eac78..d1cb41d6a0 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -487,7 +487,13 @@ var mw = ( function ( $, undefined ) { // TODO: Use requestAnimationFrame in the future which will // perform even better by not injecting styles while the browser // is paiting. - setTimeout( addEmbeddedCSS ); + setTimeout( function () { + // Can't pass addEmbeddedCSS to setTimeout directly because Firefox + // (below version 13) has the non-standard behaviour of passing a + // numerical "lateness" value as first argument to this callback + // http://benalman.com/news/2009/07/the-mysterious-firefox-settime/ + addEmbeddedCSS(); + } ); return; }