Skip to content
Permalink
Browse files

Fix #11217. WebKit clone() loses check if name follows checked attrib…

…ute.

Please folks, hold your questions. We don't explain em, we just fix em.
  • Loading branch information...
sindresorhus authored and dmethvin committed Feb 9, 2012
1 parent 2803a5e commit 92cd9990971a097b6639607b0d1172e9fe6d0dca
Showing with 11 additions and 1 deletion.
  1. +4 −0 src/support.js
  2. +7 −1 test/unit/manipulation.js
@@ -131,6 +131,10 @@ jQuery.support = (function() {
support.radioValue = input.value === "t";

input.setAttribute("checked", "checked");

// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "name", "t" );

div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.lastChild );
@@ -265,7 +265,7 @@ test("unwrap()", function() {
});

var testAppend = function(valueObj) {
expect(41);
expect(46);
var defaultText = "Try them out:"
var result = jQuery("#first").append(valueObj("<b>buga</b>"));
equal( result.text(), defaultText + "buga", "Check if text appending works" );
@@ -317,6 +317,12 @@ var testAppend = function(valueObj) {
ok( jQuery(this).is(":checked"), "Append HTML5-formated checked radio");
}).remove();

QUnit.reset();
jQuery("form").append(valueObj("<input type='radio' checked='checked' name='radiotest' />"));
jQuery("form input[name=radiotest]").each(function(){
ok( jQuery(this).is(":checked"), "Append with name attribute after checked attribute");
}).remove();

QUnit.reset();
jQuery("#sap").append(valueObj( document.getElementById("form") ));
equal( jQuery("#sap>form").size(), 1, "Check for appending a form" ); // Bug #910

0 comments on commit 92cd999

Please sign in to comment.
You can’t perform that action at this time.