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
This commit is contained in:
Timo Tijhof 2016-06-06 19:21:36 +01:00 committed by Krinkle
parent 5d7f5f4b7c
commit 7bb7315d41

View file

@ -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' ];
}
}