* 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)
| 486 | * @return {?DOMElement} |
| 487 | */ |
| 488 | function getActiveElement(doc) /*?DOMElement*/{ |
| 489 | doc = doc || (typeof document !== 'undefined' ? document : undefined); |
| 490 | if (typeof doc === 'undefined') { |
| 491 | return null; |
| 492 | } |
| 493 | try { |
| 494 | return doc.activeElement || doc.body; |
| 495 | } catch (e) { |
| 496 | return doc.body; |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | module.exports = getActiveElement; |
| 501 | },{}],11:[function(require,module,exports){ |
no outgoing calls
no test coverage detected