resourceloader: Restrict addModuleStyles() to type=styles modules
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 29 Jun 2017 02:18:06 +0000 (19:18 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 29 Jun 2017 02:18:06 +0000 (19:18 -0700)
commited28e106e366fea109b85413fc9e23b88724d283
treea171aaa1031fd5979c34a286a00aa5a88dce993d
parentc55aae02d0428ee24121c09f22b05e1ebc3957b9
resourceloader: Restrict addModuleStyles() to type=styles modules

If a type=general module is enqueued, don't try to load it as a
stylesheet.

* Per a464d1d41d69f12fe, state tracking is already disabled for
  these loads (as otherwise we wrongly claim state=ready, when in
  fact only the styles and not the scripts were loaded).

* The warning was added in a464d1d41d69f12fe.

* Default install (tested in Vagrant), Wikimedia Beta cluster, and
  Wikimedia production have seen zero violations of this warning
  in the past 7 days.

Raise severity to ERROR and add the 'continue' statement so that
these are now not loaded at all.

Bug: T92459
Change-Id: I211d56ac2df479ebf5b98667c613ecf81489539b
includes/resourceloader/ResourceLoaderClientHtml.php
tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php