Fix #11291. Always clone XML docs with a genuine .cloneNode().

This commit is contained in:
Arne de Bree
2012-02-09 20:48:21 -05:00
committed by Dave Methvin
parent 96bb57d4ef
commit bf7a4df22a
2 changed files with 13 additions and 3 deletions

View File

@@ -1218,6 +1218,16 @@ test("clone() on XML nodes", function() {
});
}
test("clone() on local XML nodes with html5 nodename", function() {
expect(2);
var $xmlDoc = jQuery( jQuery.parseXML( "<root><meter /></root>" ) ),
$meter = $xmlDoc.find( "meter" ).clone();
equal( $meter[0].nodeName, "meter", "Check if nodeName was not changed due to cloning" );
equal( $meter[0].nodeType, 1, "Check if nodeType is not changed due to cloning" );
} );
test("html(undefined)", function() {
expect(1);
equal( jQuery("#foo").html("<i>test</i>").html(undefined).html().toLowerCase(), "<i>test</i>", ".html(undefined) is chainable (#5571)" );