Skip to content

Commit

Permalink
IE doesn't allow inserting '' as a style rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Rosas authored and Benjamin Rosas committed May 28, 2014
1 parent 3f49b16 commit 9c3b713
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scoped.js
Expand Up @@ -164,9 +164,11 @@ var scopedPolyFill = ( function ( doc, undefined ) {
if ( !rule.type || 1 === rule.type ) {

styleRule = rule.style.cssText;
sheet.removeRule ? sheet.removeRule( index ) : sheet.deleteRule( index );
sheet.addRule ? sheet.addRule( selector, styleRule ) : sheet.insertRule( selector + '{' + styleRule + '}', index );

// IE doesn't allow inserting of '' as a styleRule
if (styleRule) {
sheet.removeRule ? sheet.removeRule( index ) : sheet.deleteRule( index );
sheet.addRule ? sheet.addRule( selector, styleRule ) : sheet.insertRule( selector + '{' + styleRule + '}', index );
}
}
}
}
Expand Down

0 comments on commit 9c3b713

Please sign in to comment.