resourceloader: Never defer execution for top loading modules
authorRoan Kattouw <roan.kattouw@gmail.com>
Tue, 23 Jul 2013 01:18:01 +0000 (18:18 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 27 Sep 2013 17:56:09 +0000 (19:56 +0200)
commita7a84e45c011ad74d2c79394786e8d7e71a6fb34
tree0c2005744533ce3f08b0f1b647345e7112a1e62b
parent6d0a4f463e49db7fab930f38cd9bb5a8c5c8deb4
resourceloader: Never defer execution for top loading modules

There was a bug where if a module was in the top queue but had CSS,
its execution would be deferred until its CSS was ready. This would
cause the module's execution to occur after document ready and after
user scripts had run.

This is bad because top-loaded modules are supposed to be guaranteed
to run before document ready.

Fix this by skipping the wait-for-CSS logic when loading synchronously.
Top-loading modules' execution is now guaranteed to block loading the
rest of the page, but their CSS isn't guaranteed to be ready at this
point. Which is fine, because they shouldn't be measuring things in the
DOM before document ready anyway.

Change-Id: I5779cdef336be184741ad97ea84113eb7790dd39
resources/mediawiki/mediawiki.js