You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 19, 2018. It is now read-only.
Is it legitimate for addEventListener to know whether each type of event is cancelable and be able to throw when asking for a cancelable event of a type that is never cancelable? Perhaps that should just silently proceed with uncancelable events?
The text was updated successfully, but these errors were encountered:
At minimum, Chrome would need to provide a devtools warning in this case.
Are there cases where throwing would be useful for browser feature detection? For instance, if an event type is cancelable in some browsers but not others, then if addEventListener throws, you can test if the event type is cancelable on the current browser, and if not, use some alternative behavior.
Are there cases where throwing would be useful for browser feature detection?
I think relying on exceptions for feature detection is generally discouraged. I mentioned here that I could imagine us wanting to add an API like TouchEvent.supportsCancelation if we someday decide to revoke the ability for a poorly performing page to cancel any touch events.
Still, I agree the exception might be more useful than silently doing the wrong thing. Silently doing the wrong thing is more "webby" though :-)
Is it legitimate for addEventListener to know whether each type of event is cancelable and be able to throw when asking for a cancelable event of a type that is never cancelable? Perhaps that should just silently proceed with uncancelable events?
The text was updated successfully, but these errors were encountered: