mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 12:14:54 -05:00
CSS: make the getStyles function more readable
The new version is not only simpler to read but also smaller by 6 bytes gzipped. Closes gh-2393
This commit is contained in:
committed by
Michał Gołębiowski
parent
5153b5334e
commit
3a0d582cf6
@@ -1,12 +1,15 @@
|
||||
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;
|
||||
|
||||
if ( !view.opener ) {
|
||||
view = window;
|
||||
}
|
||||
|
||||
return window.getComputedStyle( elem );
|
||||
return view.getComputedStyle( elem );
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user