]> source.dussan.org Git - jquery.git/commitdiff
Optimizing isXMLDoc.
authorJohn Resig <jeresig@gmail.com>
Wed, 22 Jul 2009 17:30:17 +0000 (17:30 +0000)
committerJohn Resig <jeresig@gmail.com>
Wed, 22 Jul 2009 17:30:17 +0000 (17:30 +0000)
src/core.js

index 460a1dad205586ef3ca237470f3cbf6ffd00f60f..b105c4c5b9d920a8d35c5cf3e1c8a3e3a313c157 100644 (file)
@@ -311,8 +311,7 @@ jQuery.extend({
 
        // check if an element is in a (or is an) XML document
        isXMLDoc: function( elem ) {
-               return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
-                       !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
+               return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML";
        },
 
        // Evalulates a script in a global context