r109506 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109505‎ | r109506 | r109507 >
Date:06:15, 19 January 2012
Author:santhosh
Status:ok
Tags:
Comment:
Fix the issues found by qunit tests - reset should restore the font-size.
And some return value changes to make the methods testable.
Modified paths:
  • /trunk/extensions/WebFonts/resources/ext.webfonts.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WebFonts/resources/ext.webfonts.js
@@ -62,14 +62,11 @@
6363 * Reset the font with old configuration
6464 */
6565 reset: function() {
66 - $( 'body' ).css( {
 66+ $( 'body, input, select, textarea' ).css( {
6767 fontFamily: mw.webfonts.oldconfig.fontFamily,
6868 fontSize: mw.webfonts.oldconfig.fontSize
6969 });
7070
71 - // font-family of <input>, <select> and <textarea> must be reset explicitly.
72 - $( 'input, select, textarea' ).css( 'font-family', mw.webfonts.oldconfig.fontFamily );
73 -
7471 // Reset the fonts applied for tags with lang attribute.
7572 $( '.webfonts-lang-attr' ).css( 'font-family', '' ).removeClass( 'webfonts-lang-attr' );
7673
@@ -182,10 +179,10 @@
183180 var ua = navigator.userAgent;
184181 if ( /MSIE 6/i.test( ua ) ) {
185182 // IE6 doesn't have font fallbacks
186 - return;
 183+ return false;
187184 } else if ( /MSIE 8/i.test( ua ) && /Windows NT 5.1/i.test( ua ) ) {
188185 // IE8 on XP has occasional gibberish bug
189 - return;
 186+ return false;
190187 }
191188 }
192189
@@ -236,6 +233,7 @@
237234 // for the main language, because there may be lang attr based font embedding.
238235 mw.webfonts.buildMenu( fonts );
239236 }
 237+ return true;
240238 },
241239
242240 /**

Status & tagging log