[whatwg/dom] Simple EventListenerOptions feature detection (#491)

After over a year [of debating it](https://github.com/WICG/EventListenerOptions/issues/31) we seem no closer to having consensus on [a generic mechanism for dictionary feature detection](https://github.com/heycam/webidl/issues/107).  In the meantime I keep hearing people site the difficulty of feature detection as the biggest problem with passive event listeners.  For example @cramforce [keeps using this](https://twitter.com/cramforce/status/896411316633481216) as an example of why performance-sensitive applications often need to do browser-conditional-behavior based on UA-sniffing instead of feature detection.

I'd love to see a generic solution, but I don't have the expertise or time to keep pushing the debate.  We've got other APIs already that work around this problem, like [mediadevices.getSupportedConstraints](https://w3c.github.io/mediacapture-main/getusermedia.html#dom-mediadevices-getsupportedconstraints).  I suggest that for now we just perpetuate that pattern by adding:

```webidl
  interface EventTarget {
    AddEventListenerOptions getSupportedOptions();
  }
```

Which returns a dictionary with each supported option value set to true.  Thoughts?
@annevk @dtapuska @tabatkins @domenic @bzbarsky 

-- 
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/491

Received on Saturday, 12 August 2017 17:43:01 UTC