Skip to content
Permalink
Browse files

Simplified the isXML function, no need to use recursion.

  • Loading branch information...
jeresig committed Feb 25, 2009
1 parent 1c5db3b commit 4bbb70b4eb0bcd93c99c0bfcfcf4fc44504c4c41
Showing with 7 additions and 4 deletions.
  1. +6 −3 src/core.js
  2. +1 −1 src/selector.js
@@ -291,9 +291,12 @@ jQuery.fn = jQuery.prototype = {
jQuery.find( selector, this[0], ret );
return ret;
} else {
return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
return jQuery.find( selector, elem );
})), "find", selector );
var ret = this.pushStack( "", "find", selector );
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.find( selector, this[i], ret );
}
//jQuery.find.uniqueSort( ret );
return ret;
}
},

@@ -941,7 +941,7 @@ var contains = document.compareDocumentPosition ? function(a, b){

var isXML = function(elem){
return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
!!elem.ownerDocument && isXML( elem.ownerDocument );
!!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
};

var posProcess = function(selector, context){

0 comments on commit 4bbb70b

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