From 944484c3fe001bcfea52fd85612042d7475597a1 Mon Sep 17 00:00:00 2001 From: John Resig Date: Mon, 12 Jan 2009 16:02:55 +0000 Subject: [PATCH] Merged in from Sizzle - a change to child filter selector logic. --- src/selector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/selector.js b/src/selector.js index 2235d7a5..085f0b32 100644 --- a/src/selector.js +++ b/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 ) {