Add a separate config for content.media.less

It's already shipped when $wgParserEnableLegacyMediaDOM is disabled, but
having separate config for it will allow us to leave it enabled should
we re-enable $wgParserEnableLegacyMediaDOM and still have content in
the cache that needs styling.

Bug: T292498
Bug: T51097
Change-Id: I027d3a718b0c1a3eebe4b55983540ad2f28d229a
This commit is contained in:
Arlo Breault 2021-10-05 17:59:09 -04:00
parent dcd793203b
commit 8b5f95a963
2 changed files with 15 additions and 2 deletions

View file

@ -4981,6 +4981,15 @@ $wgTidyConfig = [];
*/
$wgParserEnableLegacyMediaDOM = true;
/**
* Temporary flag to ship the styles for the media HTML structure that replaces
* legacy, when $wgParserEnableLegacyMediaDOM is `false`. This is configured
* separately so that it can continue to be served after the latter is disabled
* but still in the cache.
* @internal
*/
$wgUseContentMediaStyles = false;
/**
* Allow raw, unchecked HTML in "<html>...</html>" sections.
* THIS IS VERY DANGEROUS on a publicly editable site, so USE $wgGroupPermissions

View file

@ -62,7 +62,8 @@ class ResourceLoaderSkinModule extends ResourceLoaderLessVarFileModule {
*
* "content-media":
* Styles for thumbnails and floated elements.
* Will add styles for the new media structure on wikis where $wgParserEnableLegacyMediaDOM is disabled.
* Will add styles for the new media structure on wikis where $wgParserEnableLegacyMediaDOM is disabled,
* or $wgUseContentMediaStyles is enabled.
* See https://www.mediawiki.org/wiki/Parsing/Media_structure
*
* "content-links":
@ -355,7 +356,10 @@ class ResourceLoaderSkinModule extends ResourceLoaderLessVarFileModule {
);
}
}
if ( $feature === 'content-media' && !$this->getConfig()->get( 'ParserEnableLegacyMediaDOM' ) ) {
if ( $feature === 'content-media' && (
!$this->getConfig()->get( 'ParserEnableLegacyMediaDOM' ) ||
$this->getConfig()->get( 'UseContentMediaStyles' )
) ) {
$featureFilePaths['screen'][] = new ResourceLoaderFilePath(
'resources/src/mediawiki.skinning/content.media.less',
$defaultLocalBasePath,