* Gets the target node from a native browser event by accounting for * inconsistencies in browser DOM APIs. * * @param {object} nativeEvent Native browser event. * @return {DOMEventTarget} Target node.
(nativeEvent)
| 3445 | */ |
| 3446 | |
| 3447 | function getEventTarget(nativeEvent) { |
| 3448 | // Fallback to nativeEvent.srcElement for IE9 |
| 3449 | // https://github.com/facebook/react/issues/12506 |
| 3450 | var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963 |
| 3451 | |
| 3452 | if (target.correspondingUseElement) { |
| 3453 | target = target.correspondingUseElement; |
| 3454 | } // Safari may fire events on text nodes (Node.TEXT_NODE is 3). |
| 3455 | // @see http://www.quirksmode.org/js/events_properties.html |
| 3456 | |
| 3457 | |
| 3458 | return target.nodeType === TEXT_NODE ? target.parentNode : target; |
| 3459 | } |
| 3460 | |
| 3461 | /** |
| 3462 | * Checks if an event is supported in the current execution environment. |
no outgoing calls
no test coverage detected