3 exports.__esModule = true;
4 exports['default'] = computedStyle;
6 var _window = require('global/window');
8 var _window2 = _interopRequireDefault(_window);
10 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
13 * A safe getComputedStyle with an IE8 fallback.
15 * This is needed because in Firefox, if the player is loaded in an iframe with
16 * `display:none`, then `getComputedStyle` returns `null`, so, we do a null-check to
17 * make sure that the player doesn't break in these cases.
20 * The element you want the computed style of
22 * @param {string} prop
23 * The property name you want
25 * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397
27 function computedStyle(el, prop) {
32 if (typeof _window2['default'].getComputedStyle === 'function') {
33 var cs = _window2['default'].getComputedStyle(el);
35 return cs ? cs[prop] : '';
38 return el.currentStyle[prop] || '';
40 * @file computed-style.js
41 * @module computed-style