Re: Making selectors first-class citizens

On Wed, Sep 11, 2013 at 2:52 PM, Rick Waldron <waldron.rick@gmail.com> wrote:
> A prime use case: a cache of selector objects that are useful when matching
> event.target for event handler delegation patterns. Can you describe the
> Selector instance object a little more? Thanks!

It would be called Selectors, not Selector, as it represents a group
of selectors (as always with selectors). It would be opaque as to
allow for optimizations to the data model over time. And it would have
a test method that takes an element and returns either true or false
as to whether it's a match for that node given node's root (defined in
DOM).

We could add more methods in the future if the above first step works
out. E.g. selectors.match(tree) -> Elements object and such.


-- 
http://annevankesteren.nl/

Received on Wednesday, 11 September 2013 14:18:17 UTC