Commit 558d03f2 authored by John Resig's avatar John Resig

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

parent 4694e537
...@@ -684,21 +684,22 @@ try { ...@@ -684,21 +684,22 @@ try {
if ( document.querySelectorAll ) (function(){ if ( document.querySelectorAll ) (function(){
var oldSizzle = Sizzle; var oldSizzle = Sizzle;
Sizzle = function(query, context, extra){ Sizzle = function(query, context, extra, seed){
context = context || document; context = context || document;
if ( context.nodeType === 9 ) { if ( !seed && context.nodeType === 9 ) {
try { try {
return makeArray( context.querySelectorAll(query) ); return makeArray( context.querySelectorAll(query) );
} catch(e){} } catch(e){}
} }
return oldSizzle(query, context, extra); return oldSizzle(query, context, extra, seed);
}; };
Sizzle.find = oldSizzle.find; Sizzle.find = oldSizzle.find;
Sizzle.filter = oldSizzle.filter; Sizzle.filter = oldSizzle.filter;
Sizzle.selectors = oldSizzle.selectors; Sizzle.selectors = oldSizzle.selectors;
Sizzle.matches = oldSizzle.matches;
})(); })();
if ( document.documentElement.getElementsByClassName ) { if ( document.documentElement.getElementsByClassName ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment