aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-02-25 15:37:09 +0000
committerJohn Resig <jeresig@gmail.com>2009-02-25 15:37:09 +0000
commit4bbb70b4eb0bcd93c99c0bfcfcf4fc44504c4c41 (patch)
treea594a4e3ff93df59e4f296e12ab13f15d69c782e
parent1c5db3babaf32f6faa7e9e867990110c9713f64b (diff)
downloadjquery-4bbb70b4eb0bcd93c99c0bfcfcf4fc44504c4c41.tar.gz
jquery-4bbb70b4eb0bcd93c99c0bfcfcf4fc44504c4c41.zip
Simplified the isXML function, no need to use recursion.
-rw-r--r--src/core.js9
-rw-r--r--src/selector.js2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/core.js b/src/core.js
index d99f401f2..55e62363f 100644
--- a/src/core.js
+++ b/src/core.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;
}
},
diff --git a/src/selector.js b/src/selector.js
index 48aeea551..0199a2709 100644
--- a/src/selector.js
+++ b/src/selector.js
@@ -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){