W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2014

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

From: David Håsäther <hasather@gmail.com>
Date: Sat, 13 Sep 2014 07:12:23 +0200
Message-ID: <CAMPaTMdTkie9aDKBHw9o6foxb-vzXfTATMxe_QqTsv8KFQdi7g@mail.gmail.com>
To: Garrett Smith <dhtmlkitchen@gmail.com>, Anne van Kesteren <annevk@annevk.nl>
Cc: "www-style@w3.org" <www-style@w3.org>, "www-dom@w3.org" <www-dom@w3.org>, Boris Zbarsky <bzbarsky@mit.edu>, "Tab Atkins Jr." <jackalmage@gmail.com>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:23 UTC