Re: [dom] element.closest(selector, container) (#162)

This has been filed as an issue before, but was closed due to lack of interest: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26841

You can always do something like this:

```javascript
const closestEle = ele.closest(".blah");
if (containerEle.contains(closestEle)) {
   ...
}
```

This does not have the performance benefits, but I doubt `closest()` being a bottleneck, ever.

I'm not really opposed to it though, personally. I use it every time I use event delegation.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/162#issuecomment-182604595

Received on Wednesday, 10 February 2016 22:20:12 UTC