* Same as document.activeElement but wraps in a try-catch block. In IE it is * not safe to call document.activeElement if there is nothing focused. * * The activeElement will be null only if the document or document body is not * yet defined. * * @param {?DOMDocument} doc Defaults to current d
(doc)
| 312 | * @return {?DOMElement} |
| 313 | */ |
| 314 | function getActiveElement(doc) /*?DOMElement*/{ |
| 315 | doc = doc || (typeof document !== 'undefined' ? document : undefined); |
| 316 | if (typeof doc === 'undefined') { |
| 317 | return null; |
| 318 | } |
| 319 | try { |
| 320 | return doc.activeElement || doc.body; |
| 321 | } catch (e) { |
| 322 | return doc.body; |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | module.exports = getActiveElement; |
| 327 | },{}],9:[function(require,module,exports){ |
no outgoing calls
no test coverage detected