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

Selectors: hooks needed by DOM

From: Anne van Kesteren <annevk@annevk.nl>
Date: Thu, 12 Sep 2013 15:40:20 +0100
Message-ID: <CADnb78gksSqPO5bYzZOgcm34QML381ujxBGJMsA5VjXXRoTi_g@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>
Cc: Domenic Denicola <domenic@domenicdenicola.com>
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.


-- 
http://annevankesteren.nl/
Received on Thursday, 12 September 2013 14:40:48 UTC

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