From: Bartosz DziewoƄski Date: Thu, 16 Aug 2018 21:46:21 +0000 (+0200) Subject: Load styles in 'oojs-ui-widgets' again rather than a separate module X-Git-Tag: 1.34.0-rc.0~4352^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=bebcceb742c6481fec883fa826a40096b5b917b4;p=lhc%2Fweb%2Fwiklou.git Load styles in 'oojs-ui-widgets' again rather than a separate module OOUI's 'widgets' style module must be loaded after its 'core' style module, because the styles need the rules to be in this order to work. We can't enforce a dependency from 'oojs-ui-widgets.styles' on 'oojs-ui-core.styles', because it is a style-only module (it can't have dependencies). When both of these modules are loaded as style-only modules (using addModuleStyles() in PHP), everything works fine, because they are loaded in alphabetical order. But when they are loaded as dependencies from JS code, the order is unspecified. Move OOUI 'widgets' styles back into the 'oojs-ui-widgets' module (partially reverting fc65ff17d9f132aa332c99f7da44b92f6a372826) to avoid the problem. When 'oojs-ui-widgets.styles' is loaded on a page that also includes 'oojs-ui-widgets' (e.g. Special:Preferences), unfortunately the styles will be loaded twice. I don't see a way to avoid this problem. Bug: T195544 Change-Id: Ia07189f96b423b218ecbc52acffdedca517d2b01 --- diff --git a/resources/Resources.php b/resources/Resources.php index 710d54a32c..68404f4f24 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -2872,9 +2872,9 @@ return [ 'oojs-ui-widgets' => [ 'class' => ResourceLoaderOOUIFileModule::class, 'scripts' => 'resources/lib/oojs-ui/oojs-ui-widgets.js', + 'themeStyles' => 'widgets', 'dependencies' => [ 'oojs-ui-core', - 'oojs-ui-widgets.styles', 'oojs-ui.styles.icons-interactions', 'oojs-ui.styles.icons-content', 'oojs-ui.styles.icons-editing-advanced',