X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderClientHtml.php;h=ec408c742bbfd9c65bb806689a51eec905deb06e;hb=61702397aa04572251869935245c07a0821f6c4a;hp=2b3db22a48c557f668df2713c82ed68d6c143d8e;hpb=90f5b55fa48a719905e828dbf731b078e71f6374;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderClientHtml.php b/includes/resourceloader/ResourceLoaderClientHtml.php index 2b3db22a48..ec408c742b 100644 --- a/includes/resourceloader/ResourceLoaderClientHtml.php +++ b/includes/resourceloader/ResourceLoaderClientHtml.php @@ -22,7 +22,7 @@ use Wikimedia\WrappedString; use Wikimedia\WrappedStringList; /** - * Bootstrap a ResourceLoader client on an HTML page. + * Load and configure a ResourceLoader client on an HTML page. * * @since 1.28 */ @@ -450,19 +450,17 @@ class ResourceLoaderClientHtml { // Decide whether to use 'style' or 'script' element if ( $only === ResourceLoaderModule::TYPE_STYLES ) { $chunk = Html::linkedStyle( $url ); + } elseif ( $context->getRaw() || $isRaw ) { + $chunk = Html::element( 'script', [ + // In SpecialJavaScriptTest, QUnit must load synchronous + 'async' => !isset( $extraQuery['sync'] ), + 'src' => $url + ] ); } else { - if ( $context->getRaw() || $isRaw ) { - $chunk = Html::element( 'script', [ - // In SpecialJavaScriptTest, QUnit must load synchronous - 'async' => !isset( $extraQuery['sync'] ), - 'src' => $url - ] ); - } else { - $chunk = ResourceLoader::makeInlineScript( - Xml::encodeJsCall( 'mw.loader.load', [ $url ] ), - $nonce - ); - } + $chunk = ResourceLoader::makeInlineScript( + Xml::encodeJsCall( 'mw.loader.load', [ $url ] ), + $nonce + ); } if ( $group == 'noscript' ) {