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:
f52c4a3
)
Tweaked the isXMLDoc iframe test case to test the document, not the body element...
author
John Resig
<jeresig@gmail.com>
Thu, 27 Aug 2009 19:22:48 +0000
(19:22 +0000)
committer
John Resig
<jeresig@gmail.com>
Thu, 27 Aug 2009 19:22:48 +0000
(19:22 +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
890e9a2
..
23b9644
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-316,7
+316,7
@@
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.ownerDocument || elem).documentElement || 0).nodeName !== "HTML";
+ return ((elem ? elem.ownerDocument || elem : 0).documentElement || 0).nodeName !== "HTML";
},
// 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
b6dc206
..
8decd49
100644
(file)
--- a/
test/unit/core.js
+++ b/
test/unit/core.js
@@
-280,10
+280,10
@@
test("isXMLDoc - HTML", function() {
document.body.appendChild( iframe );
try {
document.body.appendChild( iframe );
try {
- var body = jQuery(iframe).contents().find("body")[0];
- ok( !jQuery.isXMLDoc( body ), "Iframe body element" );
+ var body = jQuery(iframe).contents()[0];
+ ok( jQuery.isXMLDoc( body ), "Iframe body element" );
} catch(e){
} catch(e){
- ok( false, "Iframe body element" );
+ ok( false, "Iframe body element exception" );
}
document.body.removeChild( iframe );
}
document.body.removeChild( iframe );