getStyles.js 410 B

123456789101112
  1. define(function() {
  2. return function( elem ) {
  3. // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
  4. // IE throws on elements created in popups
  5. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  6. if ( elem.ownerDocument.defaultView.opener ) {
  7. return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
  8. }
  9. return window.getComputedStyle( elem, null );
  10. };
  11. });