From: Thomas Tortorini Date: Thu, 25 Jun 2015 00:54:35 +0000 (+0200) Subject: CSS: make the getStyles function more readable X-Git-Tag: 3.0.0-alpha1+compat~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bf282ea8e20892af2d1d2c76b93b0c1f2141db97;p=jquery.git CSS: make the getStyles function more readable (cherry-picked from 3a0d582cf63b6e8f77150d9c38d2bf34d0c7790e) Closes gh-2393 --- diff --git a/src/css/curCSS.js b/src/css/curCSS.js index 271e665db..918139631 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -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 ) {