Skip to content

Commit

Permalink
CSS: make the getStyles function more readable
Browse files Browse the repository at this point in the history
(cherry-picked from 3a0d582)

Closes gh-2393
  • Loading branch information
mr21 authored and mgol committed Jun 25, 2015
1 parent f2bcf87 commit bf282ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/css/curCSS.js
Expand Up @@ -15,11 +15,13 @@ if ( window.getComputedStyle ) {
// 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;

if ( !view.opener ) {
view = window;
}

return window.getComputedStyle( elem );
return view.getComputedStyle( elem );
};

curCSS = function( elem, name, computed ) {
Expand Down

0 comments on commit bf282ea

Please sign in to comment.