* 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)
| 221 | * @return {?DOMElement} |
| 222 | */ |
| 223 | function getActiveElement(doc) /*?DOMElement*/{ |
| 224 | doc = doc || (typeof document !== 'undefined' ? document : undefined); |
| 225 | if (typeof doc === 'undefined') { |
| 226 | return null; |
| 227 | } |
| 228 | try { |
| 229 | return doc.activeElement || doc.body; |
| 230 | } catch (e) { |
| 231 | return doc.body; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | module.exports = getActiveElement; |
| 236 | },{}],8:[function(require,module,exports){ |
no outgoing calls
no test coverage detected