I made a testcase. Its not really beautiful, but maybe enough to illustrate my question:
jsfiddleJust click on the firebug-icon in the right-bottom corner to see the results. (sometimes the console is empty, dunno why, try to use Ctrl+F5)
i modified the current jquery 1.4.4 release to get these results. so some explanation:
- selectors are all selectors passed to jquery (not really interesting i think).
-
prematchcounter, prematchelements are elements that are passed to Sizzle.filter function line 3229.
-
counter, elemtents are elements that match in Sizzle.filter line 3238.
so, the main difference is, that in firefox only one element is passed to Sizzle.filter and in internet explorer 8 and opera there are 4 elements. for firefox the one element doesnt match. for ie8 there are 4 matches for CLASS, 1 for PSEUDO and 3 for TAG. In opera there are 3 matches for CLASS and 3 for TAG.
to be honest, i have no idea of jquery internals nor sizzle internals. i just try to understand and maybe somebody can explain this different handling in the browsers.