* Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "cli
(eventNameSuffix)
| 3473 | */ |
| 3474 | |
| 3475 | function isEventSupported(eventNameSuffix) { |
| 3476 | if (!canUseDOM) { |
| 3477 | return false; |
| 3478 | } |
| 3479 | |
| 3480 | var eventName = 'on' + eventNameSuffix; |
| 3481 | var isSupported = eventName in document; |
| 3482 | |
| 3483 | if (!isSupported) { |
| 3484 | var element = document.createElement('div'); |
| 3485 | element.setAttribute(eventName, 'return;'); |
| 3486 | isSupported = typeof element[eventName] === 'function'; |
| 3487 | } |
| 3488 | |
| 3489 | return isSupported; |
| 3490 | } |
| 3491 | |
| 3492 | /** |
| 3493 | * Summary of `DOMEventPluginSystem` event handling: |
no outgoing calls
no test coverage detected