resourceloader: Only output ResourceLoaderDynamicStyles when needed
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 26 Jun 2019 23:20:33 +0000 (00:20 +0100)
committerKrinkle <krinklemail@gmail.com>
Thu, 4 Jul 2019 19:14:39 +0000 (19:14 +0000)
commita69880e05cfd5197862af2c248177a5b3bef9aee
tree7da725e668c00da6a53a7d52f3ada57a212e8928
parent63e1c961cb62ee55e45a1a68f5a6f65565c034de
resourceloader: Only output ResourceLoaderDynamicStyles when needed

In mediawiki.js, this marker has always been optional, falling back to
appending to <head>. When no stylesheets need to be after the marker
(e.g. no site styles on the wiki, and user is not logged-in), then
there is no need for the marker to exist.

In a previous refactor, I was going to do this and created an
"$append" variable in the function to do what this commit does,
but I forgot to actually use it for anything.

Test Plan:
* Local wiki, with no MediaWiki:Common/{Skinname}.css pages existing.
* When logged-out, before this change, there is a marker, now there is not.
* When creating "MediaWiki:Group-user.css" and logging in, there is still
  a marker, and it is still above the <link> for that user styles request
  in the <head>.

Bug: T219342
Change-Id: I2e9657f318088860916823efeb96ae4f1532974c
includes/OutputPage.php
tests/phpunit/includes/OutputPageTest.php