resourceloader: Make 'site.styles' actually in group 'site'
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 25 Aug 2016 20:32:05 +0000 (13:32 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 25 Aug 2016 20:39:01 +0000 (13:39 -0700)
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
includes/resourceloader/ResourceLoaderSiteStylesModule.php

index c7499b1..77dbde7 100644 (file)
@@ -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 ) ) {
index 46808a1..79922bf 100644 (file)
@@ -50,4 +50,11 @@ class ResourceLoaderSiteStylesModule extends ResourceLoaderWikiModule {
        public function getType() {
                return self::LOAD_STYLES;
        }
+
+       /**
+        * @return string
+        */
+       public function getGroup() {
+               return 'site';
+       }
 }