aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2013-09-11 14:29:15 -0500
committerTimmy Willison <timmywillisn@gmail.com>2013-09-11 14:29:15 -0500
commit6d2c5c715aa53a13025fca6e8efa6533481c5e73 (patch)
tree0dfb7409cb8edd131120e10faab4a07ef1d4c7af /src
parent8a832797c0b47a0da9bfe036742df2271c041394 (diff)
downloadjquery-6d2c5c715aa53a13025fca6e8efa6533481c5e73.tar.gz
jquery-6d2c5c715aa53a13025fca6e8efa6533481c5e73.zip
Correct the checkClone support test for Safari 5.1 and mobile webkits
Diffstat (limited to 'src')
-rw-r--r--src/manipulation/support.js25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/manipulation/support.js b/src/manipulation/support.js
index 434dd48fe..e077399b0 100644
--- a/src/manipulation/support.js
+++ b/src/manipulation/support.js
@@ -3,26 +3,23 @@ define([
], function( support ){
(function () {
- var input = document.createElement( "input" ),
- fragment = document.createDocumentFragment();
+ var input,
+ fragment = document.createDocumentFragment(),
+ div = fragment.appendChild( document.createElement( "div" ) );
- input.type = "checkbox";
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ div.innerHTML = "<input type='radio' checked name='t'/>";
+
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
+ // old WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Make sure checked status is properly cloned
// Support: IE9, IE10
+ input = document.createElement("input");
+ input.type = "checkbox";
input.checked = true;
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" );
-
- fragment.appendChild( input );
-
- // Support: iOS 5.1, Android 4.x, Android 2.3
- // old WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
})();
return support;