Re: [jQuery] :first selector perofmance question

2007-03-02 Thread Klaus Hartl
Brice Burgess schrieb: John Resig wrote: Unfortunately, not in any way that is universally practical. The div:first query is obviously improvable, but when you get into queries like [EMAIL PROTECTED] it becomes a lot less clear. I'll think about improving TAG:first/last - as that seems like

Re: [jQuery] :first selector perofmance question

2007-03-02 Thread Klaus Hartl
Sam Collett schrieb: It's in the works: http://www.w3.org/TR/selectors-api/ But that will take another few years I think. Until then we're lucky to have jQuery. -- Klaus Knowing how long the W3C takes on recommendations and the lack of willingness of a certain browser developer to

Re: [jQuery] :first selector perofmance question

2007-03-02 Thread John Resig
I wonder how hard it is to implement? I mean, the parser is already there for CSS. John, tell us some Mozilla internals ;-) I know that getElementsByClassName is already in Firefox 3, we'll have to see if something like CSS selectors does, though. The problem is that CSS selectors they don't,

Re: [jQuery] :first selector perofmance question

2007-03-01 Thread Brice Burgess
John Resig wrote: Unfortunately, not in any way that is universally practical. The div:first query is obviously improvable, but when you get into queries like [EMAIL PROTECTED] it becomes a lot less clear. I'll think about improving TAG:first/last - as that seems like a common case, at

Re: [jQuery] :first selector perofmance question

2007-03-01 Thread Brice Burgess
Brice Burgess wrote: what would we need jQuery for then though? ;( Apologies to anyone offended by this. Besides the most excellent selectors, the real power of jQ lays in its extendibility, traversal/manipulation routines, animation stack, and ease of ajax! In my opinion at least ;) ~

[jQuery] :first selector perofmance question

2007-02-28 Thread Brice Burgess
I am searching for the fastest way to fetch the first visible input of a page, and currently using: $(':input:visible')[0] I thought this could be improved with the :first selector, and indeed it seems so (as it avoids memory assignments for all matched visible inputs), so I narrowed it

Re: [jQuery] :first selector perofmance question

2007-02-28 Thread Yehuda Katz
This is a smart optimization for :first. John, is this doable? -- Yehuda On 3/1/07, Brice Burgess [EMAIL PROTECTED] wrote: I am searching for the fastest way to fetch the first visible input of a page, and currently using: $(':input:visible')[0] I thought this could be improved with the

Re: [jQuery] :first selector perofmance question

2007-02-28 Thread John Resig
Unfortunately, not in any way that is universally practical. The div:first query is obviously improvable, but when you get into queries like [EMAIL PROTECTED] it becomes a lot less clear. I'll think about improving TAG:first/last - as that seems like a common case, at least. --John On 3/1/07,