Skip to content

Commit

Permalink
IE8 borks on custom build that excludes fontface and generatedcontent…
Browse files Browse the repository at this point in the history
… tests fixes issue #288

- IE8 returns an empty string when the above two tests are excluded so we check if it's empty or not to stop it breaking.
  • Loading branch information
ryanseddon committed Jun 3, 2011
1 parent 7d92285 commit ff92dce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ window.Modernizr = (function( window, document, undefined ) {

injectElementWithStyles(style, function( node, rule ) {
var style = document.styleSheets[document.styleSheets.length - 1],
cssText = style.cssText || style.cssRules[0].cssText,
// IE8 will bork if you create a custom build that excludes both fontface and generatedcontent tests.
// So we check if cssText is empty or not.
// More here: https://github.com/Modernizr/Modernizr/issues/288
cssText = style.cssText.length >= 0 ? style.cssText : style.cssRules[0].cssText,
children = node.childNodes, hash = {};

while ( len-- ) {
Expand Down

0 comments on commit ff92dce

Please sign in to comment.