* 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)
| 349 | * @return {?DOMElement} |
| 350 | */ |
| 351 | function getActiveElement(doc) /*?DOMElement*/{ |
| 352 | doc = doc || (typeof document !== 'undefined' ? document : undefined); |
| 353 | if (typeof doc === 'undefined') { |
| 354 | return null; |
| 355 | } |
| 356 | try { |
| 357 | return doc.activeElement || doc.body; |
| 358 | } catch (e) { |
| 359 | return doc.body; |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | module.exports = getActiveElement; |
| 364 | },{}],12:[function(require,module,exports){ |
no outgoing calls
no test coverage detected