jenkins-bot has submitted this change and it was merged.

Change subject: Update jquery.webfonts.js to upstream dcbed4f
......................................................................


Update jquery.webfonts.js to upstream dcbed4f

Changes, 364c43..dcbed4f:
* dcbed4f Remove magic date from version query string
* 2354edc Merge pull request #35 from siebrand/4
* 6efa320 Update formatting
* faa1d08 Cleanup whitespace and comments

Change-Id: I84ae5f8299bbb7eb5dca4a2c1a404715b365bfe9
---
M lib/jquery.webfonts.js
1 file changed, 15 insertions(+), 8 deletions(-)

Approvals:
  Santhosh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/jquery.webfonts.js b/lib/jquery.webfonts.js
index c034348..f3edc3e 100644
--- a/lib/jquery.webfonts.js
+++ b/lib/jquery.webfonts.js
@@ -211,16 +211,25 @@
 
                                // Load and apply fonts for other language 
tagged elements (batched)
                                if ( element.lang && element.lang !== 
webfonts.language ) {
-                                       // Child element's language differs 
from parent.
                                        fontFamily = webfonts.getFont( 
element.lang );
 
                                        if ( !fontFamily ) {
-                                               // If there is no explicit font 
for this language, it will
-                                               // inherit the webfont for the 
parent.  But that is undesirable here
-                                               // since language is different. 
So inherit the original font of the
-                                               // element. Define it 
explicitly so that inheritance is broken.
-                                               fontFamily = 
webfonts.originalFontFamily;
+                                               // No font preference for the 
language.
+                                               // Check if we need to reset 
for this language.
+                                               // If the font of the parent 
element, to which webfonts were applied,
+                                               // remained the same, there is 
no need to reset.
+                                               if ( webfonts.$element.css( 
'fontFamily' ) !== webfonts.originalFontFamily ) {
+                                                       // The parent font 
changed.
+                                                       // Is there an 
inheritance?
+                                                       // Is the font for this 
element the same as parent's font?
+                                                       if ( fontFamilyStyle 
=== webfonts.$element.css( 'fontFamily' ) ) {
+                                                               // Break 
inheritance of the font from the parent element
+                                                               // by applying 
the original font to this element
+                                                               fontFamily = 
webfonts.originalFontFamily;
+                                                       }
+                                               }
                                        }
+
                                        // We do not have fonts for all 
languages
                                        if ( fontFamily !== null ) {
                                                append( fontQueue, fontFamily );
@@ -365,8 +374,6 @@
                        if ( fontconfig.fontweight ) {
                                fontFaceRule += '\tfont-weight:' + 
fontconfig.fontweight + ';';
                        }
-
-                       fontFaceRule += '\tfont-style:' + fontStyle + ';';
 
                        if ( fontconfig.fontweight !== undefined ) {
                                fontFaceRule += '\tfont-weight:' + 
fontconfig.fontweight + ';';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I84ae5f8299bbb7eb5dca4a2c1a404715b365bfe9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: KartikMistry <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to