X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderClientHtml.php;h=a9e2f924888b1227dcc414a8d7655d8a05916f88;hb=743eca95e3065abf3091d343a4ab88ee4508483a;hp=fe9e56f7366e2ae58bfabd5d6fec2e2273856563;hpb=8b06e7acf762b8750aa97f65cf54c387852388cc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderClientHtml.php b/includes/resourceloader/ResourceLoaderClientHtml.php index fe9e56f736..a9e2f92488 100644 --- a/includes/resourceloader/ResourceLoaderClientHtml.php +++ b/includes/resourceloader/ResourceLoaderClientHtml.php @@ -131,9 +131,7 @@ class ResourceLoaderClientHtml { // moduleName => state ], 'general' => [], - 'styles' => [ - // moduleName - ], + 'styles' => [], 'scripts' => [], // Embedding for private modules 'embed' => [ @@ -182,20 +180,17 @@ class ResourceLoaderClientHtml { } // Stylesheet doesn't trigger mw.loader callback. - // Set "ready" state to allow dependencies and avoid duplicate requests. (T87871) + // Set "ready" state to allow script modules to depend on this module (T87871). + // And to avoid duplicate requests at run-time from mw.loader. $data['states'][$name] = 'ready'; $group = $module->getGroup(); $context = $this->getContext( $group, ResourceLoaderModule::TYPE_STYLES ); - if ( $module->isKnownEmpty( $context ) ) { - // Avoid needless request for empty module - $data['states'][$name] = 'ready'; - } else { + // Avoid needless request for empty module + if ( !$module->isKnownEmpty( $context ) ) { if ( $module->shouldEmbedModule( $this->context ) ) { // Embed via style element $data['embed']['styles'][] = $name; - // Avoid duplicate request from mw.loader - $data['states'][$name] = 'ready'; } else { // Load from load.php?only=styles via $data['styles'][] = $name;