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: Sun, 21 Sep 2014 16:07:44 -0400
Message-ID: <541F3010.2010407@mit.edu>
To: Sean Hogan <shogun70@westnet.com.au>, Anne van Kesteren <annevk@annevk.nl>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, "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/21/14, 8:02 AM, Sean Hogan wrote:
> If no explicit scoping root is passed then EITHER:
>      the selector must be an absolute selector

:matches and :closest only allow absolute selectors right now, right? 
So this is basically proposing an extension to the current spec to allow 
relative selectors if an explicit scoping root is passed in?

>      the implied scoping root is assumed to be the **document** or
> fragment or virtual fragment of E.

What is a "virtual fragment"?

> E.closest(selector, scope) attempts to find a matching element by
> testing E against the selector, and if that fails then testing E's
> parent, and-so-on until the scoping root is reached. The scoping root is
> NOT tested, even if it is an element.

OK.  But the scoping root is supposed to match :scope, even in absolute 

> If the scoping root is assumed to be E then you can only have absolute
> selectors.

Right now this API only supports absolute selectors.

Received on Sunday, 21 September 2014 20:08:23 UTC

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