]> source.dussan.org Git - jquery.git/commitdiff
Fix support test for checkClone. Fixes Safari 5.1 manip failures.
authorTimmy Willison <timmywillisn@gmail.com>
Wed, 11 Sep 2013 14:51:31 +0000 (09:51 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Wed, 11 Sep 2013 14:51:31 +0000 (09:51 -0500)
src/manipulation.js
src/manipulation/support.js

index d8b45528cb82ff4629667466f6e84be4113eab34..c51175570672eed2fc11687a75f7d43d6374d8e4 100644 (file)
@@ -488,8 +488,9 @@ jQuery.fn.extend({
                        isFunction = jQuery.isFunction( value );
 
                // We can't cloneNode fragments that contain checked, in WebKit
-               if ( isFunction || !( l <= 1 || typeof value !== "string" || support.checkClone ||
-                               !rchecked.test( value ) ) ) {
+               if ( isFunction ||
+                               ( l > 1 && typeof value === "string" &&
+                                       !support.checkClone && rchecked.test( value ) ) ) {
                        return this.each(function( index ) {
                                var self = set.eq( index );
                                if ( isFunction ) {
index 7435de7d9e7b4cd6d11c94508fa9eb4fd6606b1c..434dd48feca132dee37469858cef6ad7a1541cf0 100644 (file)
@@ -14,6 +14,7 @@ define([
        support.noCloneChecked = input.cloneNode( true ).checked;
 
        // #11217 - WebKit loses check when the name is after the checked attribute
+       input.checked = false;
        input.setAttribute( "checked", "t" );
        input.setAttribute( "name", "t" );