mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 07:55:09 -05:00
CSS: Do not throw on frame elements in FF
IE9-10 throws on elements created in popups (see #14150), FF meanwhile throws on frame elements through "defaultView.getComputedStyle" (see #15098) Use "defaultView" if in the popup which would fix IE issue, use "window.getComputedStyle" which would fix FF issue. And everybody wins, except performance, but who cares right? Fixes #15098 Closes gh-1583
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
define(function() {
|
||||
return function( elem ) {
|
||||
return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
|
||||
// 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, null );
|
||||
}
|
||||
|
||||
return window.getComputedStyle( elem, null );
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user