Permalink
Browse files

Merged in from Sizzle - a change to child filter selector logic.

  • Loading branch information...
1 parent 95094d1 commit 944484c3fe001bcfea52fd85612042d7475597a1 @jeresig jeresig committed Jan 12, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/selector.js
View
4 src/selector.js
@@ -513,9 +513,9 @@ var Expr = Sizzle.selectors = {
CHILD: function(elem, match){
var type = match[1], parent = elem.parentNode;
- var doneName = match[0];
+ var doneName = "child" + parent.childNodes.length;
- if ( parent && !parent[ doneName ] ) {
+ if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) {
var count = 1;
for ( var node = parent.firstChild; node; node = node.nextSibling ) {

0 comments on commit 944484c

Please sign in to comment.