From: Timo Tijhof Date: Thu, 25 Aug 2016 20:32:05 +0000 (-0700) Subject: resourceloader: Make 'site.styles' actually in group 'site' X-Git-Tag: 1.31.0-rc.0~5883^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=471adc7ef9c8ed9b052601d25994c2117ea5b7ce;p=lhc%2Fweb%2Fwiklou.git resourceloader: Make 'site.styles' actually in group 'site' Before 93ed259cf and 7bb7315d4, 'site' and 'site.styles' module were one module loaded in two parts. One part via the general queue (not in a separate request), and the other part in the stylesheet queue (in a separate request). This was achieved by hacking the stylesheet queue handler to hardcode the group to be 'site' for a module named 'site' (later 'site.styles' in c20a76ee) eventhough the module as a whole was not actually in that group. Now that these modules are separated, this hack is no longer needed and the module can be registered as being in group 'site' properly. Change-Id: If193f556be211749b115f3808ee46536b578fb22 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index c7499b1b45..77dbde7175 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2688,12 +2688,6 @@ class OutputPage extends ContextSource { // Special case in buildExemptModules() return false; } - if ( $name === 'site.styles' ) { - // HACK: Technically, 'site.styles' isn't in a separate request group. - // But, in order to ensure its styles are in the right position, - // pretend it's in a group called 'site'. - $group = 'site'; - } if ( isset( $exemptGroups[$group] ) ) { $exemptStates[$name] = 'ready'; if ( !$module->isKnownEmpty( $context ) ) { diff --git a/includes/resourceloader/ResourceLoaderSiteStylesModule.php b/includes/resourceloader/ResourceLoaderSiteStylesModule.php index 46808a1c28..79922bfe36 100644 --- a/includes/resourceloader/ResourceLoaderSiteStylesModule.php +++ b/includes/resourceloader/ResourceLoaderSiteStylesModule.php @@ -50,4 +50,11 @@ class ResourceLoaderSiteStylesModule extends ResourceLoaderWikiModule { public function getType() { return self::LOAD_STYLES; } + + /** + * @return string + */ + public function getGroup() { + return 'site'; + } }