* 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)
| 383 | * @return {?DOMElement} |
| 384 | */ |
| 385 | function getActiveElement(doc) /*?DOMElement*/{ |
| 386 | doc = doc || (typeof document !== 'undefined' ? document : undefined); |
| 387 | if (typeof doc === 'undefined') { |
| 388 | return null; |
| 389 | } |
| 390 | try { |
| 391 | return doc.activeElement || doc.body; |
| 392 | } catch (e) { |
| 393 | return doc.body; |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | module.exports = getActiveElement; |
| 398 | },{}],9:[function(require,module,exports){ |
no outgoing calls
no test coverage detected