diff --git a/src/selector.js b/src/selector.js index 32817e94..e58b2571 100644 --- a/src/selector.js +++ b/src/selector.js @@ -68,7 +68,7 @@ var Sizzle = function(selector, context, results, seed) { if ( context ) { var ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, contextXML ); + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) {