From d6e541426d10b335fa3b6b481ae591ede977c480 Mon Sep 17 00:00:00 2001 From: John Resig Date: Mon, 19 Jan 2009 18:56:02 +0000 Subject: [PATCH] Fixed the logic for determining if an XML file is being used. Fixes jQuery bug #3896. --- src/selector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/selector.js b/src/selector.js index 682a92ebe..9fffeabd7 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.documentElement && !elem.body || - elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; + return elem && elem.nodeType === 9 && elem.nodeName !== "HTML" || + isXML( elem.ownerDocument ); }; var posProcess = function(selector, context){