diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-05-25 20:48:59 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-05-25 20:48:59 -0400 |
commit | 9d4033d629fbfd1352e4ee5f20d0d320a61b80f1 (patch) | |
tree | 28c99dc64c98a7b4079467c2392f66b7659af99e /test | |
parent | bdce86dc2edb43267ec5c4b7aab6d1932f294d6f (diff) | |
download | jquery-9d4033d629fbfd1352e4ee5f20d0d320a61b80f1.tar.gz jquery-9d4033d629fbfd1352e4ee5f20d0d320a61b80f1.zip |
Add test for appending an xml element to another. Supplements #9370.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/manipulation.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index ad3d04848..b9bc75873 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -465,6 +465,40 @@ test("append the same fragment with events (Bug #6997, 5566)", function () { jQuery("#listWithTabIndex li.test6997").eq(1).click(); }); +test("append(xml)", function() { + expect( 1 ); + + function createXMLDoc() { + // Initialize DOM based upon latest installed MSXML or Netscape + var elem, + aActiveX = + [ "MSXML6.DomDocument", + "MSXML3.DomDocument", + "MSXML2.DomDocument", + "MSXML.DomDocument", + "Microsoft.XmlDom" ]; + + if ( document.implementation && "createDocument" in document.implementation ) { + return document.implementation.createDocument( "", "", null ); + } else { + // IE + for ( var n = 0, len = aActiveX.length; n < len; n++ ) { + try { + elem = new ActiveXObject( aActiveX[ n ] ); + return elem; + } catch(_){}; + } + } + } + + var xmlDoc = createXMLDoc(), + xml1 = xmlDoc.createElement("head"), + xml2 = xmlDoc.createElement("test"); + + ok( jQuery( xml1 ).append( xml2 ), "Append an xml element to another without raising an exception." ); + +}); + test("appendTo(String|Element|Array<Element>|jQuery)", function() { expect(16); |