* wrapper around getComputedStyle, to fix issues with Firefox returning null when * called inside of a hidden iframe * * @access private * @function computedStyle * @param {HTMLElement|SVGElement} elem - The element we want to find the computed styles of * @param {string|null} [pse
(elem, pseudo, prop)
| 12 | * @returns {CSSStyleDeclaration} the value of the specified CSS property |
| 13 | */ |
| 14 | function computedStyle(elem, pseudo, prop) { |
| 15 | var result; |
| 16 | |
| 17 | if ('getComputedStyle' in window) { |
| 18 | result = getComputedStyle.call(window, elem, pseudo); |
| 19 | var console = window.console; |
| 20 | |
| 21 | if (result !== null) { |
| 22 | if (prop) { |
| 23 | result = result.getPropertyValue(prop); |
| 24 | } |
| 25 | } else { |
| 26 | if (console) { |
| 27 | var method = console.error ? 'error' : 'log'; |
| 28 | console[method].call(console, 'getComputedStyle returning null, its possible modernizr test results are inaccurate'); |
| 29 | } |
| 30 | } |
| 31 | } else { |
| 32 | result = !pseudo && elem.currentStyle && elem.currentStyle[prop]; |
| 33 | } |
| 34 | |
| 35 | return result; |
| 36 | } |
| 37 | |
| 38 | return computedStyle; |
| 39 | }); |
no outgoing calls
no test coverage detected
searching dependent graphs…