jenkins-bot has submitted this change and it was merged. Change subject: Update jquery.webfonts from upstream ......................................................................
Update jquery.webfonts from upstream Bug: 49151 Change-Id: I9dd87f44c0465801ac225a1bdc6268e85f89911e --- M lib/jquery.webfonts.js 1 file changed, 14 insertions(+), 2 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/jquery.webfonts.js b/lib/jquery.webfonts.js index 72b41b6..b4c0b5e 100644 --- a/lib/jquery.webfonts.js +++ b/lib/jquery.webfonts.js @@ -103,10 +103,13 @@ // jQuery.css(). if ( fontFamily ) { this.load( fontFamily ); - fontStack.unshift( fontFamily ); + // Avoid duplicates + if ( $.inArray( fontFamily, fontStack ) < 0 ) { + fontStack.unshift( fontFamily ); + } } - if ( !fontFamily || fontFamily === this.originalFontFamily ) { + if ( !fontFamily ) { // We are resetting the font to original font. fontStack = []; // This will cause removing inline fontFamily style. @@ -204,7 +207,16 @@ // 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; + } // We do not have fonts for all languages if ( fontFamily !== null ) { append( fontQueue, fontFamily ); -- To view, visit https://gerrit.wikimedia.org/r/80554 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9dd87f44c0465801ac225a1bdc6268e85f89911e Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com> Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il> Gerrit-Reviewer: KartikMistry <kartik.mis...@gmail.com> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits