[whatwg/dom] Increase the ability to query whether the host environment supports a specific event (#968)

We hope to solve the problem of obtaining whether the current host environment itself provides a certain event capability according to the "feature judgment" under the Web standard, so as to know whether a specific event capability can be used in the current host environment.

for example:

Take the [dblclick](https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event) as an example. On the mobile terminal, browsers such as safari and firefox support it, but chrome and android WebView do not. At this time, if we don't have "feature judgment", we need to code like the following.

```js
if (/Chrome/.test(window.navigator.userAgent)) {
  // Realize by other means, such as judging 2 clicks
} else {
  element.addEventListener('dblclick', (e)=>{
    //...
  });
}
```

Obviously, we can implement related functions through "environmental judgment", but when the historical version and the variety of browsers bring a lot of judgment conditions.

We expect to expand on eventTarget to solve this problem.

More detailed content - [https://github.com/answershuto/isEventSupports](https://github.com/answershuto/isEventSupports).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/968

Received on Tuesday, 13 April 2021 07:55:36 UTC