From 82e8d11c12f160fbf07a8faef5931c2f7a364a6a Mon Sep 17 00:00:00 2001 From: John Resig Date: Mon, 19 Jan 2009 21:57:18 +0000 Subject: [PATCH] Re-worked the logic for handling isXML detection. --- src/selector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/selector.js b/src/selector.js index 9fffeab..3371119 100644 --- a/src/selector.js +++ b/src/selector.js @@ -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){ -- 1.7.10.4