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

Re: Selectors: hooks needed by DOM

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 30 Sep 2013 16:42:45 -0700
Message-ID: <CAAWBYDCQGgH8qLi=JXWWLf8JsnvyPtnLASpj7=iRDVvB8UPpAA@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: "www-style@w3.org" <www-style@w3.org>, Domenic Denicola <domenic@domenicdenicola.com>
On Thu, Sep 12, 2013 at 7:40 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> http://dom.spec.whatwg.org/ now defines the "Selectors API", i.e. the
> query/queryAll/querySelector/querySelectorAll methods and a new
> Elements object that has query/queryAll.
>
> I found the need for these hooks:
>
> 1) Parsing a selectors string and that either returning an opaque
> representation of selectors or failure.
>
> 2) Parsing a relative selectors string against an
> Element/Document/DocumentFragment node or set of Element nodes and
> that either returning an opaque representation of selectors or
> failure.
>
> 3) Matching an opaque representation of selectors against a tree using
> a scoping root Element/Document/DocumentFragment node.
>
> I implement additional logic on top of 3) in
> http://dom.spec.whatwg.org/#evaluate-a-relative-selectors-string and
> this leads me to thinking that if you want to define that logic we
> could instead define matching as an opaque representation of selectors
> against an Element/Document/DocumentFragment node or set of Element
> nodes. Because if you have the selectors and the node or set of nodes,
> you can find the tree(s) and do all the work. Let me know how you'd
> prefer to organize this.

All right, I think I've defined everything you need:
<http://dev.w3.org/csswg/selectors/#api-hooks>

Let me know if something is missing or clumsy, and I'll try to adjust.

~TJ
Received on Monday, 30 September 2013 23:43:32 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:32 UTC