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 5691236a4c1ee614b244c43996e888e5ca5c3b0a
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/css/var/getStyles.js
@@ -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.
You can’t perform that action at this time.