]> source.dussan.org Git - jquery.git/commitdiff
CSS: make the getStyles function more readable
authorThomas Tortorini <thomastortorini@gmail.com>
Thu, 25 Jun 2015 00:54:35 +0000 (02:54 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Thu, 25 Jun 2015 00:55:06 +0000 (02:55 +0200)
(cherry-picked from 3a0d582cf63b6e8f77150d9c38d2bf34d0c7790e)

Closes gh-2393

src/css/curCSS.js

index 271e665dbb7e01003dce9d3008214d88f301ad3a..918139631ff4585529d27e297722a504923ee6dd 100644 (file)
@@ -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 ) {