Skip to content

Commit

Permalink
Fixed the logic for determining if an XML file is being used. Fixes j…
Browse files Browse the repository at this point in the history
…Query bug #3896.
  • Loading branch information
jeresig committed Jan 19, 2009
1 parent 1d513ef commit d6e5414
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/selector.js
Expand Up @@ -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){
Expand Down

0 comments on commit d6e5414

Please sign in to comment.