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

"Tab Atkins Jr." <[email protected]>
Newsgroups gmane.comp.web.dom.general,gmane.comp.web.css.general
Message-ID <CAAWBYDBQ6kQh-45nus3kNiFfq5KGyL+Q_ZQKrGRW08uJ2yohLQ@mail.gmail.com>
On Tue, Sep 2, 2014 at 2:48 AM, Anne van Kesteren <[email protected]> wrote:
> In https://bugzilla.mozilla.org/show_bug.cgi?id=886308#c29 bz points
> out that I introduced a regression relative to the old definition of
> matches() with the new hook in Selectors.
>
> I guess the way to fix this for matches() would be to add a :scope
> elements argument.

You're just referring to the internal ":scope elements" arg for the
matching algo, right?  Not adding an argument to matches()?  If so,
then yes, just passing the element as the sole :scope element will
work fine.

> What about closest(), should it have that argument
> too?

Yes, go ahead and do so.  While it's not usually going to be useful
(as the argument to closest() is a compound selector matched against
the element's ancestors), it could be used in a :has() pseudo.

~TJ
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.