From: Timo Tijhof Date: Mon, 6 Jun 2016 18:21:36 +0000 (+0100) Subject: resourceloader: Remove styles from 'site', depend on 'site.styles' X-Git-Tag: 1.31.0-rc.0~6195^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=7bb7315d4;p=lhc%2Fweb%2Fwiklou.git resourceloader: Remove styles from 'site', depend on 'site.styles' For legacy reasons, the site module has always been both a script module and a page-style module at the same time. Meaning, the styles and scripts portion of it don't directly relate to each other, rather they both relate to the page directly. As such, they should be loaded separately. Loading it as a dynamic module is not an option as its styles should be top-loaded and not depend on JavaScript. The restriction that will be put it place for T92459 also requires the module be split. For environments that use static file or proxy caching, this MUST be deployed after Ic137cb494 and I8b6c6a1 have been deployed and all cache has rolled over. Bug: T92459 Bug: T108590 Change-Id: Id2342454bdc87a7c4d194f7350caa699ec4054b9 --- diff --git a/includes/resourceloader/ResourceLoaderSiteModule.php b/includes/resourceloader/ResourceLoaderSiteModule.php index e01d0a138e..7401d58e70 100644 --- a/includes/resourceloader/ResourceLoaderSiteModule.php +++ b/includes/resourceloader/ResourceLoaderSiteModule.php @@ -39,12 +39,13 @@ class ResourceLoaderSiteModule extends ResourceLoaderWikiModule { $pages['MediaWiki:Common.js'] = [ 'type' => 'script' ]; $pages['MediaWiki:' . ucfirst( $context->getSkin() ) . '.js'] = [ 'type' => 'script' ]; } - if ( $this->getConfig()->get( 'UseSiteCss' ) ) { - $pages['MediaWiki:Common.css'] = [ 'type' => 'style' ]; - $pages['MediaWiki:' . ucfirst( $context->getSkin() ) . '.css'] = [ 'type' => 'style' ]; - $pages['MediaWiki:Print.css'] = [ 'type' => 'style', 'media' => 'print' ]; - - } return $pages; } + + /* + * @return array + */ + public function getDependencies( ResourceLoaderContext $context = null ) { + return [ 'site.styles' ]; + } }