Skip to content
Permalink
Browse files

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

  • Loading branch information
jeresig committed Jan 5, 2009
1 parent 4694e53 commit 558d03f24ce63d05af53420dae2c80614cf81a3b
Showing with 4 additions and 3 deletions.
  1. +4 −3 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 ) {

0 comments on commit 558d03f

Please sign in to comment.
You can’t perform that action at this time.