X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fselector.js;h=8af3a0dba4274268182414fdb0cb8ad45c17aa0b;hb=626961c4a54cccaae0ecef81f2058cd0888611cc;hp=56efd0174cf1ca68091293bab5c21b6ca4ed3ffe;hpb=aa7616cf9aac1692a483165144a42cde9a3169e0;p=jquery.git diff --git a/src/selector.js b/src/selector.js index 56efd01..8af3a0d 100644 --- a/src/selector.js +++ b/src/selector.js @@ -332,11 +332,12 @@ var Expr = Sizzle.selectors = { CLASS: function(match, curLoop, inplace, result, not){ match = " " + match[1].replace(/\\/g, "") + " "; - for ( var i = 0; curLoop[i] != null; i++ ) { - if ( curLoop[i] ) { - if ( not ^ (" " + curLoop[i].className + " ").indexOf(match) >= 0 ) { + var elem; + for ( var i = 0; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) { if ( !inplace ) - result.push( curLoop[i] ); + result.push( elem ); } else if ( inplace ) { curLoop[i] = false; } @@ -494,7 +495,7 @@ var Expr = Sizzle.selectors = { CHILD: function(elem, match){ var type = match[1], parent = elem.parentNode; - var doneName = "child" + parent.childNodes.length; + var doneName = match[0]; if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) { var count = 1; @@ -831,7 +832,7 @@ var posProcess = function(selector, context){ } return Sizzle.filter( later, tmpSet ); -} +}; // EXPOSE jQuery.find = Sizzle;