On 09.03.2009, at 01:44, Tobie Langel wrote:
> We'll be shifting to Sizzle pretty soon, which afaik allows (or could
> easily be modified to allow) both behaviours.
>
> Maybe we can make this opt-in for an upcoming release.
That would be great, I can see both use cases. I also see that
different people seem to expect different things. It would be great to
have the implementation support both ways.
BTW I like the idea of a :self pseudoclass a lot.
For example, I often need to select the child (not descendant)
elements of a given element that satisfy a given selector.
With :self I could do:
$(x).select(':self > .mixedcontent').each(...);
Right now this is the shortest I came up with, and it's not as concise
as I'm used to with Prototype:
$(x).childElements().findAll(function (e) {return
e.match('.mixedcontent')}).each(...);
:self provides the explicit link between selector evaluation and
context node that I find so surprising as default behavior.
As an aside, getElementsBySelector()'s *documentation* describes what
I'd want in the example above, it says the method selects "extended
children", but in fact it too seems to select descendants, not children.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---