Update jquery.webfonts from upstream

Bug: 49151
Change-Id: I9dd87f44c0465801ac225a1bdc6268e85f89911e
This commit is contained in:
Santhosh Thottingal
2013-08-23 18:27:16 +05:30
parent 17956d5af8
commit 35f7172a11

View File

@@ -103,10 +103,13 @@
// jQuery.css(). // jQuery.css().
if ( fontFamily ) { if ( fontFamily ) {
this.load( fontFamily ); this.load( fontFamily );
// Avoid duplicates
if ( $.inArray( fontFamily, fontStack ) < 0 ) {
fontStack.unshift( fontFamily ); fontStack.unshift( fontFamily );
} }
}
if ( !fontFamily || fontFamily === this.originalFontFamily ) { if ( !fontFamily ) {
// We are resetting the font to original font. // We are resetting the font to original font.
fontStack = []; fontStack = [];
// This will cause removing inline fontFamily style. // This will cause removing inline fontFamily style.
@@ -204,7 +207,16 @@
// Load and apply fonts for other language tagged elements (batched) // Load and apply fonts for other language tagged elements (batched)
if ( element.lang && element.lang !== webfonts.language ) { if ( element.lang && element.lang !== webfonts.language ) {
// Child element's language differs from parent.
fontFamily = webfonts.getFont( element.lang ); 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 // We do not have fonts for all languages
if ( fontFamily !== null ) { if ( fontFamily !== null ) {
append( fontQueue, fontFamily ); append( fontQueue, fontFamily );