jenkins-bot has submitted this change and it was merged. Change subject: Add 'noflip' option on RL modules to disable CSSJanus ......................................................................
Add 'noflip' option on RL modules to disable CSSJanus Should be useful for cases where we pull in an external library that already manages RTL flipping in its styles, and CSSJanus does the wrong thing without extra markup. Example: 'ext.tmh.video-js' => $baseExtensionResource + [ 'scripts' => 'resources/videojs/video.js', 'styles' => 'resources/videojs/video-js.css', 'noflip' => true, ... ], Bug: T148572 Bug: T148565 Change-Id: Icbad20d8a6e9a0d354ad159f5816f4fb67cc2775 --- M docs/extension.schema.json M docs/extension.schema.v1.json M includes/resourceloader/ResourceLoaderFileModule.php 3 files changed, 13 insertions(+), 1 deletion(-) Approvals: Paladox: Looks good to me, but someone else must approve Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/docs/extension.schema.json b/docs/extension.schema.json index 84a404a..e408d03 100644 --- a/docs/extension.schema.json +++ b/docs/extension.schema.json @@ -222,6 +222,10 @@ "items": { "type": "string" } + }, + "noflip": { + "type": "boolean", + "description": "Whether to skip CSSJanus LTR-to-RTL flipping for this module. Recommended for styles imported from libraries that already properly handle their RTL styles. Default is false, meaning CSSJanus will be applied on RTL-mode output." } } }, diff --git a/docs/extension.schema.v1.json b/docs/extension.schema.v1.json index 9499927..6d48a06 100644 --- a/docs/extension.schema.v1.json +++ b/docs/extension.schema.v1.json @@ -222,6 +222,10 @@ "items": { "type": "string" } + }, + "noflip": { + "type": "boolean", + "description": "Whether to skip CSSJanus LTR-to-RTL flipping for this module. Recommended for styles imported from libraries that already properly handle their RTL styles. Default is false, meaning CSSJanus will be applied on RTL-mode output." } } }, diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 2dcc841..07649e3 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -128,6 +128,9 @@ protected $targets = [ 'desktop' ]; + /** @var bool Whether CSSJanus flipping should be skipped for this module */ + protected $noflip = false; + /** * @var bool Whether getStyleURLsForDebug should return raw file paths, * or return load.php urls @@ -277,6 +280,7 @@ // Single booleans case 'debugRaw': case 'raw': + case 'noflip': $this->{$member} = (bool)$option; break; } @@ -913,7 +917,7 @@ * @return bool */ public function getFlip( $context ) { - return $context->getDirection() === 'rtl'; + return $context->getDirection() === 'rtl' && !$this->noflip; } /** -- To view, visit https://gerrit.wikimedia.org/r/316611 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbad20d8a6e9a0d354ad159f5816f4fb67cc2775 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brion VIBBER <br...@wikimedia.org> Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits