Re-worked the logic for handling isXML detection.

This commit is contained in:
John Resig 2009-01-19 21:57:18 +00:00
parent 96152559e0
commit 82e8d11c12

View file

@ -809,8 +809,8 @@ var contains = document.compareDocumentPosition ? function(a, b){
};
var isXML = function(elem){
return elem && elem.nodeType === 9 && elem.nodeName !== "HTML" ||
isXML( elem.ownerDocument );
return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
!!elem.ownerDocument && isXML( elem.ownerDocument );
};
var posProcess = function(selector, context){