Ori.livneh has uploaded a new change for review.

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

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
(cherry picked from commit 11e47561e4652adf1180987f28a2d673286937a0)
---
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/75/230575/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 3491e91..bb3b1be 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2904,7 +2904,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 d18b97b..49e8833 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1682,6 +1682,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/230575
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: wmf/1.26wmf17
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>

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

Reply via email to