Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/230487

Change subject: Load 'mediawiki.legacy.commonPrint' styles with a media type 
property
......................................................................

Load 'mediawiki.legacy.commonPrint' styles with a media type property

Split the 'mediawiki.legacy.commonPrint' styles into a separate <style>
tag which sets media="print", which will make it a non-render blocking
resource.

Bug: T108413
Change-Id: Ife1d65b31bc79f96d7b89b94fdaeb2babf7ddf40
---
M includes/OutputPage.php
M resources/Resources.php
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/230487/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 72d8a7c..26f9efa 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2909,7 +2909,8 @@
 
                                // Automatically select style/script elements
                                if ( $only === 
ResourceLoaderModule::TYPE_STYLES ) {
-                                       $link = Html::linkedStyle( $url );
+                                       $media = $group === 'print' ? 'print' : 
'all';
+                                       $link = Html::linkedStyle( $url, $media 
);
                                } else {
                                        if ( $context->getRaw() || $isRaw ) {
                                                // Startup module can't load 
itself, needs to use <script> instead of mw.loader.load
diff --git a/resources/Resources.php b/resources/Resources.php
index 2396128..24c150e 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1674,6 +1674,7 @@
                'styles' => array(
                        'resources/src/mediawiki.legacy/commonPrint.css' => 
array( 'media' => 'print' )
                ),
+               'group' => 'print',
        ),
        'mediawiki.legacy.protect' => array(
                'scripts' => 'resources/src/mediawiki.legacy/protect.js',

-- 
To view, visit https://gerrit.wikimedia.org/r/230487
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife1d65b31bc79f96d7b89b94fdaeb2babf7ddf40
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to