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

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.web.dom.general,gmane.comp.web.css.general
Message-ID <[email protected]>
On 9/1/14, 1:04 PM, Tab Atkins Jr. wrote:
>> 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.

I'd like to be clear on what the proposal is for closest().  Is it:

1)  Pass the element that closest() was called on as the :scope elements 
argument to all the calls up the parent chain.

or

2)  Pass the element that you're matchign against as the :scope elements 
argument.

?  #2 is what you get if you desugar closest() in terms of matches(), 
but #1 seems to be closer to the use case Tab is thinking of, right?

-Boris
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.