From: John Resig Date: Mon, 5 Jan 2009 02:45:20 +0000 (+0000) Subject: Merging from Sizzle (fixed a bug when querySelectorAll is used. X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=558d03f24ce63d05af53420dae2c80614cf81a3b;p=jquery.git Merging from Sizzle (fixed a bug when querySelectorAll is used. --- diff --git a/src/selector.js b/src/selector.js index 9540119..b3d8dbc 100644 --- a/src/selector.js +++ b/src/selector.js @@ -684,21 +684,22 @@ try { if ( document.querySelectorAll ) (function(){ var oldSizzle = Sizzle; - Sizzle = function(query, context, extra){ + Sizzle = function(query, context, extra, seed){ context = context || document; - if ( context.nodeType === 9 ) { + if ( !seed && context.nodeType === 9 ) { try { return makeArray( context.querySelectorAll(query) ); } catch(e){} } - return oldSizzle(query, context, extra); + return oldSizzle(query, context, extra, seed); }; Sizzle.find = oldSizzle.find; Sizzle.filter = oldSizzle.filter; Sizzle.selectors = oldSizzle.selectors; + Sizzle.matches = oldSizzle.matches; })(); if ( document.documentElement.getElementsByClassName ) {