From 471adc7ef9c8ed9b052601d25994c2117ea5b7ce Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 25 Aug 2016 13:32:05 -0700 Subject: [PATCH] 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 --- includes/OutputPage.php | 6 ------ includes/resourceloader/ResourceLoaderSiteStylesModule.php | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) 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'; + } } -- 2.20.1