Behavior of matches() and closest() with :scope()

On Saturday, September 13, 2014, Garrett Smith <dhtmlkitchen@gmail.com>
wrote:
>
> > I guess the way to fix this for matches() would be to add a :scope
> > elements argument. What about closest(), should it have that argument
> > too?
> >
>
> Closest what -- ancestor? parent? sibling?


Closest inclusive ancestor:
http://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor


> I've never been a fan of jQuery, but the method names there are actually
> quite a bit less bad.


jQuery's closest() was the inspiration for the name.

Anne, passing the element that closest() was called on makes the most sense
to me too.


-- 
David Håsäther

Received on Saturday, 13 September 2014 05:12:53 UTC