-
Notifications
You must be signed in to change notification settings - Fork 50.5k
Use 'document.createEvent' not 'new Event' #5157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes facebook#5153. This seems to work in all browsers I tested, including old Android and all IE > 8 which didn't work before.
|
Looks reasonable to me. |
Use 'document.createEvent' not 'new Event'
|
The only reason I didn't use this to begin with is because of the scary deprecation notice on MDN. Can you confirm you're not getting a deprecation warning? Also add a feature test for createEvent just in case. |
|
No deprecation warning in Firefox or Chrome. createEvent is supported in everything since IE9 as far as I can tell. It was introduced in the same spec as dispatchEvent was. I can add a feature test if you really want one though? |
|
Yea. I'm concerned that they would want to deprecate initEvent but not Event and dispatchEvent since that's what the documentation says. Not that I think browsers would but at least if we're careful they can't blame us for it.
|
Add feature test for document.createEvent
Use 'document.createEvent' not 'new Event' (cherry picked from commit 194ab16)
Add feature test for document.createEvent (cherry picked from commit da11356)
Fixes #5153.
This seems to work in all browsers I tested, including old Android and all IE > 8 which didn't work before.