Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231867
Change subject: Don't embed legacy images in render-blocking CSS
......................................................................
Don't embed legacy images in render-blocking CSS
This commit cherry-picks the following changes from master:
* I6c7e592a50: mediawiki.legacy.common: don't embed legacy images
* Ife5d84fb95: Add mediawiki.legacy.feeds
* I8e092e9d2c: mediawiki.legacy.config: use own help-field styling
* I2a2556a0a4: mediawiki.special.upload: use spinner from jquery.spinner
Change-Id: I85495fff5b0664b7b7c93c1fe8b8373e81ccd750
---
M includes/installer/WebInstaller.php
M includes/skins/SkinTemplate.php
M mw-config/config.css
M resources/Resources.php
A resources/src/mediawiki.legacy/feeds.css
M resources/src/mediawiki.legacy/shared.css
M resources/src/mediawiki.special/templates/thumbnail.html
7 files changed, 60 insertions(+), 14 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/67/231867/1
diff --git a/includes/installer/WebInstaller.php
b/includes/installer/WebInstaller.php
index 4930826..74904f1 100644
--- a/includes/installer/WebInstaller.php
+++ b/includes/installer/WebInstaller.php
@@ -696,11 +696,11 @@
$text = wfMessage( $msg, $args )->useDatabase( false )->plain();
$html = $this->parse( $text, true );
- return "<div class=\"mw-help-field-container\">\n" .
- "<span class=\"mw-help-field-hint\" title=\"" .
+ return "<div class=\"config-help-field-container\">\n" .
+ "<span class=\"config-help-field-hint\" title=\"" .
wfMessage( 'config-help-tooltip' )->escaped() . "\">" .
wfMessage( 'config-help' )->escaped() . "</span>\n" .
- "<span class=\"mw-help-field-data\">" . $html .
"</span>\n" .
+ "<span class=\"config-help-field-data\">" . $html .
"</span>\n" .
"</div>\n";
}
diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index ae78b2c..cc294f8 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -51,12 +51,16 @@
* @param OutputPage $out
*/
function setupSkinUserCss( OutputPage $out ) {
- $out->addModuleStyles( array(
+ $moduleStyles = array(
'mediawiki.legacy.shared',
'mediawiki.legacy.commonPrint',
'mediawiki.ui.button',
'mediawiki.sectionAnchor'
- ) );
+ );
+ if ( $out->isSyndicated() ) {
+ $moduleStyles[] = 'mediawiki.legacy.feeds';
+ }
+ $out->addModuleStyles( $moduleStyles );
}
/**
diff --git a/mw-config/config.css b/mw-config/config.css
index 17b2039..0e0b304 100644
--- a/mw-config/config.css
+++ b/mw-config/config.css
@@ -172,3 +172,32 @@
overflow: hidden;
min-width: 20em;
}
+
+/* tooltip styles */
+.config-help-field-hint {
+ display: none;
+ margin-left: 2px;
+ margin-bottom: -8px;
+ padding: 0 0 0 15px;
+ /* @embed */
+ background-image: url(images/help-question.gif);
+ background-position: left center;
+ background-repeat: no-repeat;
+ cursor: pointer;
+ font-size: .8em;
+ text-decoration: underline;
+ color: #0645ad;
+}
+
+.config-help-field-hint:hover {
+ /* @embed */
+ background-image: url(images/help-question-hover.gif);
+}
+
+.config-help-field-data {
+ display: block;
+ background-color: #d6f3ff;
+ padding: 5px 8px 4px 8px;
+ border: 1px solid #5dc9f4;
+ margin-left: 20px;
+}
diff --git a/resources/Resources.php b/resources/Resources.php
index 1116b79..733a86d 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1691,6 +1691,10 @@
/* MediaWiki Legacy */
+ 'mediawiki.legacy.feeds' => array(
+ 'position' => 'top',
+ 'styles' => 'resources/src/mediawiki.legacy/feeds.css',
+ ),
'mediawiki.legacy.commonPrint' => array(
'position' => 'top',
'styles' => array(
diff --git a/resources/src/mediawiki.legacy/feeds.css
b/resources/src/mediawiki.legacy/feeds.css
new file mode 100644
index 0000000..9737fd4
--- /dev/null
+++ b/resources/src/mediawiki.legacy/feeds.css
@@ -0,0 +1,12 @@
+/* Extracted from mediawiki.legacy.shared, which no longer @embeds the
+ * background image. The selector below must be more specific. */
+#feedlinks a.feedlink {
+ /* SVG support using a transparent gradient to guarantee cross-browser
+ * compatibility (browsers able to understand gradient syntax support
also SVG).
+ *
http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique */
+ background-image: url(images/feed-icon.png);
+ /* @embed */
+ background-image: -webkit-linear-gradient(transparent, transparent),
url(images/feed-icon.svg);
+ /* @embed */
+ background-image: linear-gradient(transparent, transparent),
url(images/feed-icon.svg);
+}
diff --git a/resources/src/mediawiki.legacy/shared.css
b/resources/src/mediawiki.legacy/shared.css
index b69e59d..248ea19 100644
--- a/resources/src/mediawiki.legacy/shared.css
+++ b/resources/src/mediawiki.legacy/shared.css
@@ -2,6 +2,11 @@
* CSS in this file is used by *all* skins (that have any CSS at all). Be
* careful what you put in here, since what looks good in one skin may not in
* another, but don't ignore the poor pre-Monobook users either.
+ *
+ * NOTE: The images which are referenced in this file are no longer in use in
+ * essential interface components. They should NOT be embedded, because that
+ * optimizes for the uncommon case at the cost of bloating the size of render-
+ * blocking CSS common to all pages.
*/
/* GENERAL CLASSES FOR DIRECTIONALITY SUPPORT */
@@ -265,9 +270,7 @@
* compatibility (browsers able to understand gradient syntax support
also SVG).
*
http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique */
background-image: url(images/question.png);
- /* @embed */
background-image: -webkit-linear-gradient(transparent, transparent),
url(images/question.svg);
- /* @embed */
background-image: linear-gradient(transparent, transparent),
url(images/question.svg);
background-repeat: no-repeat;
background-size: 13px 13px;
@@ -495,9 +498,7 @@
* compatibility (browsers able to understand gradient syntax support
also SVG).
*
http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique */
background-image: url(images/feed-icon.png);
- /* @embed */
background-image: -webkit-linear-gradient(transparent, transparent),
url(images/feed-icon.svg);
- /* @embed */
background-image: linear-gradient(transparent, transparent),
url(images/feed-icon.svg);
background-position: center left;
background-repeat: no-repeat;
@@ -883,7 +884,6 @@
}
.mw-ajax-loader {
- /* @embed */
background-image: url(images/ajax-loader.gif);
background-position: center center;
background-repeat: no-repeat;
@@ -895,7 +895,6 @@
.mw-small-spinner {
padding: 10px !important;
margin-right: 0.6em;
- /* @embed */
background-image: url(images/spinner.gif);
background-position: center center;
background-repeat: no-repeat;
@@ -1035,7 +1034,6 @@
margin-left: 2px;
margin-bottom: -8px;
padding: 0 0 0 15px;
- /* @embed */
background-image: url(images/help-question.gif);
background-position: left center;
background-repeat: no-repeat;
@@ -1046,7 +1044,6 @@
}
.mw-help-field-hint:hover {
- /* @embed */
background-image: url(images/help-question-hover.gif);
}
diff --git a/resources/src/mediawiki.special/templates/thumbnail.html
b/resources/src/mediawiki.special/templates/thumbnail.html
index 73042f2..4f41fad 100644
--- a/resources/src/mediawiki.special/templates/thumbnail.html
+++ b/resources/src/mediawiki.special/templates/thumbnail.html
@@ -1,6 +1,6 @@
<div id="mw-upload-thumbnail" class="thumb tright">
<div class="thumbinner">
- <div class="mw-small-spinner" style="width: 180px; height:
180px"></div>
+ <div class="mw-spinner mw-spinner-small" style="width: 180px;
height: 180px"></div>
<div class="thumbcaption">
<div class="filename"></div>
<div class="fileinfo"></div>
--
To view, visit https://gerrit.wikimedia.org/r/231867
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I85495fff5b0664b7b7c93c1fe8b8373e81ccd750
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf18
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits