]> source.dussan.org Git - jquery.git/commitdiff
Merging from Sizzle (fixed a bug when querySelectorAll is used.
authorJohn Resig <jeresig@gmail.com>
Mon, 5 Jan 2009 02:45:20 +0000 (02:45 +0000)
committerJohn Resig <jeresig@gmail.com>
Mon, 5 Jan 2009 02:45:20 +0000 (02:45 +0000)
src/selector.js

index 954011930a528d821b6fdf3a3fdfc0f912002f91..b3d8dbc9afe14fa1c496432aec46532054aa61e7 100644 (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 ) {