Skip to content

Commit 9d4033d

Browse files
author
timmywil
committed
Add test for appending an xml element to another. Supplements #9370.
1 parent bdce86d commit 9d4033d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/unit/manipulation.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,40 @@ test("append the same fragment with events (Bug #6997, 5566)", function () {
465465
jQuery("#listWithTabIndex li.test6997").eq(1).click();
466466
});
467467

468+
test("append(xml)", function() {
469+
expect( 1 );
470+
471+
function createXMLDoc() {
472+
// Initialize DOM based upon latest installed MSXML or Netscape
473+
var elem,
474+
aActiveX =
475+
[ "MSXML6.DomDocument",
476+
"MSXML3.DomDocument",
477+
"MSXML2.DomDocument",
478+
"MSXML.DomDocument",
479+
"Microsoft.XmlDom" ];
480+
481+
if ( document.implementation && "createDocument" in document.implementation ) {
482+
return document.implementation.createDocument( "", "", null );
483+
} else {
484+
// IE
485+
for ( var n = 0, len = aActiveX.length; n < len; n++ ) {
486+
try {
487+
elem = new ActiveXObject( aActiveX[ n ] );
488+
return elem;
489+
} catch(_){};
490+
}
491+
}
492+
}
493+
494+
var xmlDoc = createXMLDoc(),
495+
xml1 = xmlDoc.createElement("head"),
496+
xml2 = xmlDoc.createElement("test");
497+
498+
ok( jQuery( xml1 ).append( xml2 ), "Append an xml element to another without raising an exception." );
499+
500+
});
501+
468502
test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
469503
expect(16);
470504

0 commit comments

Comments
 (0)