https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113569
Revision: 113569
Author: nikerabbit
Date: 2012-03-11 09:27:01 +0000 (Sun, 11 Mar 2012)
Log Message:
-----------
Fix test failure.
AdBlock on Chrome adds:
<link type="text/css" rel="stylesheet" href="data:text/css,">
Which causes:
Cannot read property '0' of null
Modified Paths:
--------------
trunk/extensions/WebFonts/tests/qunit/ext.webfonts.tests.js
Modified: trunk/extensions/WebFonts/tests/qunit/ext.webfonts.tests.js
===================================================================
--- trunk/extensions/WebFonts/tests/qunit/ext.webfonts.tests.js 2012-03-11
03:25:22 UTC (rev 113568)
+++ trunk/extensions/WebFonts/tests/qunit/ext.webfonts.tests.js 2012-03-11
09:27:01 UTC (rev 113569)
@@ -18,12 +18,9 @@
// Iterate from last.
for ( styleIndex = lastStyleIndex; styleIndex > 0; styleIndex-- ) {
lastStyleSheet = document.styleSheets[styleIndex];
- if ( !lastStyleSheet ) {
+ if ( !lastStyleSheet || !lastStyleSheet.cssRules ||
!lastStyleSheet.cssRules[0] ) {
continue;
}
- if ( !lastStyleSheet.cssRules[0] ) {
- continue;
- }
cssText = lastStyleSheet.cssRules[0].cssText;
if ( cssText.indexOf( '@font-face' ) !== -1 && cssText.indexOf(
fontFamilyName ) !== -1 ) {
return true;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs