Permalink
Browse files

Re-worked the logic for handling isXML detection.

  • Loading branch information...
jeresig committed Jan 19, 2009
1 parent 9615255 commit 82e8d11c12f160fbf07a8faef5931c2f7a364a6a
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/selector.js
View
@@ -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){

0 comments on commit 82e8d11

Please sign in to comment.