Skip to content
Permalink
Browse files
CSS: save 35 bytes on the getStyles function
  • Loading branch information
mr21 committed Jun 14, 2015
1 parent 8e111df commit 5691236
Showing 1 changed file with 3 additions and 4 deletions.
@@ -1,12 +1,11 @@
define(function() {
return function( elem ) {

// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
// IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
if ( elem.ownerDocument.defaultView.opener ) {
return elem.ownerDocument.defaultView.getComputedStyle( elem );
}
var view = elem.ownerDocument.defaultView;

return window.getComputedStyle( elem );
return ( view.opener && view || window ).getComputedStyle( elem );
};
});

0 comments on commit 5691236

Please sign in to comment.