From: Michael Monteleone Date: Mon, 25 Jan 2010 23:43:33 +0000 (-0500) Subject: Make sure that checked state is cloned properly. Based upon the patch by Michael... X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=bed759c95ca6d796125653b540e8611dc63b38bb Make sure that checked state is cloned properly. Based upon the patch by Michael, required better test cases and in doing so found more edge cases. Introduced a new check into jQuery.support as a result. Fixes #5929. --- diff --git a/src/manipulation.js b/src/manipulation.js index 23463d1..4d0ffd0 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -5,6 +5,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rtagName = /<([\w:]+)/, rtbody = /buga')); equals( result.text(), defaultText + 'buga', 'Check if text appending works' ); @@ -230,6 +230,24 @@ var testAppend = function(valueObj) { ok( jQuery("#sap").append(valueObj( [] )), "Check for appending an empty array." ); ok( jQuery("#sap").append(valueObj( "" )), "Check for appending an empty string." ); ok( jQuery("#sap").append(valueObj( document.getElementsByTagName("foo") )), "Check for appending an empty nodelist." ); + + reset(); + jQuery("form").append(valueObj('')); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(':checked'), "Append checked radio"); + }).remove(); + + reset(); + jQuery("form").append(valueObj('')); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(':checked'), "Append alternately formated checked radio"); + }).remove(); + + reset(); + jQuery("form").append(valueObj('')); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(':checked'), "Append HTML5-formated checked radio"); + }).remove(); reset(); jQuery("#sap").append(valueObj( document.getElementById('form') ));