* 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)
| 441 | * @return {?DOMElement} |
| 442 | */ |
| 443 | function getActiveElement(doc) /*?DOMElement*/{ |
| 444 | doc = doc || (typeof document !== 'undefined' ? document : undefined); |
| 445 | if (typeof doc === 'undefined') { |
| 446 | return null; |
| 447 | } |
| 448 | try { |
| 449 | return doc.activeElement || doc.body; |
| 450 | } catch (e) { |
| 451 | return doc.body; |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | module.exports = getActiveElement; |
| 456 | },{}],14:[function(require,module,exports){ |
no outgoing calls
no test coverage detected