CSS: make the getStyles function more readable

(cherry-picked from 3a0d582cf6)

Closes gh-2393
This commit is contained in:
Thomas Tortorini 2015-06-25 02:54:35 +02:00 committed by Michał Gołębiowski
parent f2bcf87c25
commit bf282ea8e2

View File

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