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

David Håsäther <[email protected]>
Newsgroups gmane.comp.web.dom.general,gmane.comp.web.css.general
Message-ID <CAMPaTMdTkie9aDKBHw9o6foxb-vzXfTATMxe_QqTsv8KFQdi7g@mail.gmail.com>
On Saturday, September 13, 2014, Garrett Smith <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.