It's the spec.
Regardless, if you've got a collection of elements it's strange that the order
matters. You either access an item individually to work with it, in which case
the order doesn't matter, or you are iterating them all and doing something
different depending upon the index, which, again, shouldn't matter.
> this kind of things are jquery like...
jQuery actually breaks the spec with most of its utlility methods.
each(index, item) v. forEach(item, index)
And both selector engines (Slick and Sizzle) use QSA very often when available,
so sorting stuff out for your use case would be a total waste and slow
everything down.
> thanks Fli7e, i don't like workarounds.
Every JavaScript library / framework is a workaround from the start ... so ...
If it's just a few elements and the order is important I don't think this is a
horrible option:
els = $$($('1'), $('3'), $('2'))
http://jsfiddle.net/rpflorence/4ddrx/
On Mar 24, 2011, at 2:40 AM, Kilian C. wrote:
> I think mootools is a fx based framework.
> this kind of things are jquery like...
>
> thanks Fli7e, i don't like workarounds.
>
> On Wed, Mar 23, 2011 at 4:05 PM, Christoph Pojer <[email protected]>
> wrote:
> that's how the spec for querySelector define it and we follow that :)
>