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
"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."
}
}
},
"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."
}
}
},
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
// Single booleans
case 'debugRaw':
case 'raw':
+ case 'noflip':
$this->{$member} = (bool)$option;
break;
}
* @return bool
*/
public function getFlip( $context ) {
- return $context->getDirection() === 'rtl';
+ return $context->getDirection() === 'rtl' && !$this->noflip;
}
/**