atom feed72 messages in org.w3.public-webapiRe: ACTION-87: Selectors API
FromSent OnAttachments
30 earlier messages
Maciej StachowiakMar 22, 2006 11:25 am 
Robin BerjonMar 22, 2006 2:01 pm 
Maciej StachowiakMar 22, 2006 2:28 pm 
Ian HicksonMar 22, 2006 2:48 pm 
Ian HicksonMar 22, 2006 2:51 pm 
Maciej StachowiakMar 22, 2006 3:20 pm 
Jim LeyMar 22, 2006 6:17 pm 
Jim LeyMar 22, 2006 6:24 pm 
Anne van KesterenMar 23, 2006 4:28 am 
Ian HicksonMar 23, 2006 2:31 pm 
Anne van KesterenMar 25, 2006 4:36 am 
Ian HicksonMar 27, 2006 3:13 pm 
Anne van KesterenApr 3, 2006 5:46 am 
Anne van KesterenApr 3, 2006 5:51 am 
lioreanMay 12, 2006 8:49 pm 
Anne van KesterenMay 13, 2006 4:15 am 
lioreanMay 13, 2006 12:08 pm 
Anne van KesterenMay 13, 2006 12:26 pm 
lioreanMay 13, 2006 2:40 pm 
Anne van KesterenMay 14, 2006 7:20 am 
lioreanMay 14, 2006 4:22 pm 
Anne van KesterenMay 15, 2006 3:15 am 
lioreanMay 16, 2006 9:29 pm 
Anne van KesterenMay 17, 2006 5:18 am 
Lachlan HuntMay 17, 2006 6:19 am 
Anne van KesterenMay 17, 2006 6:30 am 
Jim LeyMay 17, 2006 6:35 am 
Lachlan HuntMay 17, 2006 7:02 am 
Robin BerjonMay 17, 2006 7:07 am 
Anne van KesterenMay 18, 2006 12:46 am 
Jonas SickingMay 30, 2006 3:11 pm 
Jonas SickingMay 30, 2006 3:24 pm 
Jonas SickingMay 30, 2006 3:42 pm 
Ian HicksonMay 30, 2006 3:55 pm 
Robin BerjonMay 30, 2006 4:15 pm 
Jonas SickingMay 30, 2006 5:56 pm 
Anne van KesterenJun 5, 2006 2:46 am 
Anne van KesterenJun 5, 2006 2:49 am 
Jonas SickingJun 5, 2006 12:31 pm 
Charles McCathieNevileJun 5, 2006 5:37 pm 
lioreanJun 5, 2006 6:16 pm 
Maciej StachowiakJun 5, 2006 10:40 pm 
Subject:Re: ACTION-87: Selectors API
From:Lachlan Hunt (lach@lachy.id.au)
Date:May 17, 2006 6:19:46 am
List:org.w3.public-webapi

Anne van Kesteren wrote:

On Wed, 17 May 2006 06:29:54 +0200, liorean <lior@gmail.com> wrote:

* Several people have raised issues with naming the methods match and matchAll as those might suggest a boolean return value. Alternate suggestions have been select and selectAll.

For ECMAScript, I think "match" is a fine choice of verb and is consistent. For the closest comparison, regex 'match' isn't boolean.

Sure, I like match() as well. Mostly because it's short and simple, but there were some concerns raised.

I like match() too because it's much shorter than getElementsBySelector(), but I think the fact that it only returns a single node is confusing and that, in most cases, authors would want the whole collection, not just the first match. I think it would be better if the methods were:

interface DocumentSelector { StaticNodeList match(in DOMString selectors, in XPathNSResolver nsresolver); Node matchOne(in DOMString selectors, in XPathNSResolver nsresolver); };

Or possibly matchFirst() instead.

<doc> /.../ <elm1> <elm2 xml:id="bleh"> <elm3/> <elm3/> <elm2> </elm1> /.../ </doc>

var selectorMatches=document.getElementById('bleh').matchAll(':root elm3',resolver);

What's wrong with using:

var selectorMatches = document.matchAll('#bleh elm3', resolver);

There may still be use cases for matching a sub tree, so it may be worth extending the Element interface too, but all the ones I can think of can be handled by simply writing a more specific selector.