Merging from Sizzle (fixed a bug when querySelectorAll is used.

This commit is contained in:
John Resig 2009-01-05 02:45:20 +00:00
parent 4694e537bc
commit 558d03f24c

View File

@ -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 ) {