Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | define( function() { |
2 | "use strict"; | ||||
3 | |||||
4 | return function( elem ) { | ||||
5 | |||||
6 | // Support: IE <=11 only, Firefox <=30 (#15098, #14150) | ||||
7 | // IE throws on elements created in popups | ||||
8 | // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" | ||||
9 | var view = elem.ownerDocument.defaultView; | ||||
10 | |||||
11 | if ( !view || !view.opener ) { | ||||
12 | view = window; | ||||
13 | } | ||||
14 | |||||
15 | return view.getComputedStyle( elem ); | ||||
16 | }; | ||||
17 | } ); |