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

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

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

Right now this API only supports absolute selectors.

-Boris

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