git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
957cd6f
)
Fixed a bug with the isXMLDoc test - also made sure that isXMLDoc was handling the...
author
John Resig
<jeresig@gmail.com>
Thu, 27 Aug 2009 20:07:45 +0000
(20:07 +0000)
committer
John Resig
<jeresig@gmail.com>
Thu, 27 Aug 2009 20:07:45 +0000
(20:07 +0000)
src/core.js
patch
|
blob
|
history
test/unit/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
23b9644
..
c8b5a46
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-316,7
+316,8
@@
jQuery.extend({
isXMLDoc: function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
isXMLDoc: function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
- return ((elem ? elem.ownerDocument || elem : 0).documentElement || 0).nodeName !== "HTML";
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
},
// Evalulates a script in a global context
},
// Evalulates a script in a global context
diff --git
a/test/unit/core.js
b/test/unit/core.js
index
8decd49
..
46858ce
100644
(file)
--- a/
test/unit/core.js
+++ b/
test/unit/core.js
@@
-281,7
+281,7
@@
test("isXMLDoc - HTML", function() {
try {
var body = jQuery(iframe).contents()[0];
try {
var body = jQuery(iframe).contents()[0];
- ok( jQuery.isXMLDoc( body ), "Iframe body element" );
+ ok( !jQuery.isXMLDoc( body ), "Iframe body element" );
} catch(e){
ok( false, "Iframe body element exception" );
}
} catch(e){
ok( false, "Iframe body element exception" );
}