Re: [whatwg/dom] Add support in `{add,remove}EventListener` for `stopPropagation` and `preventDefault` options when `passive: true` (#425)

I mean, effectively this:

```js
var old = EventTarget.prototype.addEventListener
EventTarget.prototype.addEventListener = function (listener, opts) {
    if (opts == null || !opts.passive || !opts.stopPropagation && !opts.preventDefault) {
        old.call(this, listener, opts)
    } else {
        const {stopPropagation, preventDefault} = opts
        old.call(this, ev => {
            if (stopPropagation) ev.stopPropagation()
            if (preventDefault) ev.preventDefault()
            return listener(ev)
        }, opts)
    }
}
```

Although, now that I think about it, the things affecting rendering performance (like scrolling) already have other ways of disabling them (like via CSS), so this would literally provide no benefit.

-- 
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/425#issuecomment-287598648

Received on Sunday, 19 March 2017 06:57:00 UTC