W3C home > Mailing lists > Public > www-style@w3.org > September 2014

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

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Tue, 02 Sep 2014 12:00:36 -0400
Message-ID: <5405E9A4.6020707@mit.edu>
To: "Tab Atkins Jr." <jackalmage@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>, David Håsäther <hasather@gmail.com>
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.


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

?  #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?

Received on Tuesday, 2 September 2014 16:01:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:46 UTC