Added fixes for two different :not() bugs. One with p:not(p.foo) failing and another with a weird combination of multiple selectors and filters. Fixes jQuery bug #4101.

This commit is contained in:
John Resig 2009-02-15 21:13:33 +00:00
parent f9a7cfacf7
commit 20827707a9
2 changed files with 18 additions and 4 deletions

View file

@ -223,8 +223,6 @@ Sizzle.filter = function(expr, set, inplace, not){
}
}
expr = expr.replace(/\s*,\s*/, "");
// Improper expression
if ( expr == old ) {
if ( anyFound == null ) {
@ -399,7 +397,7 @@ var Expr = Sizzle.selectors = {
PSEUDO: function(match, curLoop, inplace, result, not){
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple one
if ( match[3].match(chunker).length > 1 ) {
if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);