Merge "Add a config to stop shipping the legacy media styles"
This commit is contained in:
commit
ddb4e2ae38
6 changed files with 73 additions and 24 deletions
|
|
@ -4151,6 +4151,14 @@ config-schema:
|
|||
separately so that it can continue to be served after the latter is disabled
|
||||
but still in the cache.
|
||||
@internal
|
||||
UseLegacyMediaStyles:
|
||||
default: false
|
||||
description: |-
|
||||
Temporary flag to stop shipping the styles for the legacy media HTML structure
|
||||
that has been replaced when $wgParserEnableLegacyMediaDOM is `false`. This is
|
||||
configured separately to give time for templates and extensions that mimic the
|
||||
the parser output to be migrated away. See T318433
|
||||
@internal
|
||||
RawHtml:
|
||||
default: false
|
||||
description: |-
|
||||
|
|
|
|||
|
|
@ -2341,6 +2341,12 @@ $wgParserEnableLegacyMediaDOM = null;
|
|||
*/
|
||||
$wgUseContentMediaStyles = null;
|
||||
|
||||
/**
|
||||
* Config variable stub for the UseLegacyMediaStyles setting, for use by phpdoc and IDEs.
|
||||
* @see MediaWiki\MainConfigSchema::UseLegacyMediaStyles
|
||||
*/
|
||||
$wgUseLegacyMediaStyles = null;
|
||||
|
||||
/**
|
||||
* Config variable stub for the RawHtml setting, for use by phpdoc and IDEs.
|
||||
* @see MediaWiki\MainConfigSchema::RawHtml
|
||||
|
|
|
|||
|
|
@ -2356,6 +2356,12 @@ class MainConfigNames {
|
|||
*/
|
||||
public const UseContentMediaStyles = 'UseContentMediaStyles';
|
||||
|
||||
/**
|
||||
* Name constant for the UseLegacyMediaStyles setting, for use with Config::get()
|
||||
* @see MainConfigSchema::UseLegacyMediaStyles
|
||||
*/
|
||||
public const UseLegacyMediaStyles = 'UseLegacyMediaStyles';
|
||||
|
||||
/**
|
||||
* Name constant for the RawHtml setting, for use with Config::get()
|
||||
* @see MainConfigSchema::RawHtml
|
||||
|
|
|
|||
|
|
@ -6482,6 +6482,18 @@ class MainConfigSchema {
|
|||
'default' => false,
|
||||
];
|
||||
|
||||
/**
|
||||
* Temporary flag to stop shipping the styles for the legacy media HTML structure
|
||||
* that has been replaced when $wgParserEnableLegacyMediaDOM is `false`. This is
|
||||
* configured separately to give time for templates and extensions that mimic the
|
||||
* the parser output to be migrated away. See T318433
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public const UseLegacyMediaStyles = [
|
||||
'default' => false,
|
||||
];
|
||||
|
||||
/**
|
||||
* Allow raw, unchecked HTML in "<html>...</html>" sections.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -145,11 +145,7 @@ class SkinModule extends LessVarFileModule {
|
|||
// Reserves whitespace for the logo in a pseudo element.
|
||||
'print' => [ 'resources/src/mediawiki.skinning/logo-print.less' ],
|
||||
],
|
||||
'content-media' => [
|
||||
'all' => [ 'resources/src/mediawiki.skinning/content.thumbnails-common.less' ],
|
||||
'screen' => [ 'resources/src/mediawiki.skinning/content.thumbnails-screen.less' ],
|
||||
'print' => [ 'resources/src/mediawiki.skinning/content.thumbnails-print.less' ],
|
||||
],
|
||||
'content-media' => [],
|
||||
'content-links' => [
|
||||
'screen' => [ 'resources/src/mediawiki.skinning/content.links.less' ]
|
||||
],
|
||||
|
|
@ -413,25 +409,45 @@ class SkinModule extends LessVarFileModule {
|
|||
);
|
||||
}
|
||||
}
|
||||
if ( $feature === 'content-media' && (
|
||||
!$this->getConfig()->get( MainConfigNames::ParserEnableLegacyMediaDOM ) ||
|
||||
$this->getConfig()->get( MainConfigNames::UseContentMediaStyles )
|
||||
) ) {
|
||||
$featureFilePaths['all'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.media-common.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
$featureFilePaths['screen'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.media-screen.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
$featureFilePaths['print'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.media-print.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
|
||||
if ( $feature === 'content-media' ) {
|
||||
if ( $this->getConfig()->get( MainConfigNames::UseLegacyMediaStyles ) ) {
|
||||
$featureFilePaths['all'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.thumbnails-common.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
$featureFilePaths['screen'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.thumbnails-screen.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
$featureFilePaths['print'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.thumbnails-print.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
}
|
||||
if (
|
||||
!$this->getConfig()->get( MainConfigNames::ParserEnableLegacyMediaDOM ) ||
|
||||
$this->getConfig()->get( MainConfigNames::UseContentMediaStyles )
|
||||
) {
|
||||
$featureFilePaths['all'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.media-common.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
$featureFilePaths['screen'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.media-screen.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
$featureFilePaths['print'][] = new FilePath(
|
||||
'resources/src/mediawiki.skinning/content.media-print.less',
|
||||
$defaultLocalBasePath,
|
||||
$defaultRemoteBasePath
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -805,6 +805,7 @@ return [
|
|||
],
|
||||
'ParserEnableLegacyMediaDOM' => false,
|
||||
'UseContentMediaStyles' => false,
|
||||
'UseLegacyMediaStyles' => false,
|
||||
'RawHtml' => false,
|
||||
'ExternalLinkTarget' => false,
|
||||
'NoFollowLinks' => true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue