diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2014-01-22 15:51:20 -0800 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2014-01-23 14:14:44 -0500 |
commit | f3452912099e5d2fdaa212e88ffe7e6d59f6da42 (patch) | |
tree | 4d8887bf02a653f484c3eac893c405d6af49a924 /src/manipulation | |
parent | 49b03cf702a9b302268d51930a4ab0246c4feab3 (diff) | |
download | jquery-f3452912099e5d2fdaa212e88ffe7e6d59f6da42.tar.gz jquery-f3452912099e5d2fdaa212e88ffe7e6d59f6da42.zip |
Manipulation: Use textarea for missing IE defaultValue check
IE11 fixed the checkbox defaultValue issue but not textarea. Rather than
creating a new detect name I'm reusing the old one to protect anyone who
is unwisely using this externally. Re-fixing the defaultValue when it
doesn't need to be done is not a problem, so leave that code for IE11.
Fixes #14716
Closes gh-1495
Diffstat (limited to 'src/manipulation')
-rw-r--r-- | src/manipulation/support.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/manipulation/support.js b/src/manipulation/support.js index 427660361..b1f4941bf 100644 --- a/src/manipulation/support.js +++ b/src/manipulation/support.js @@ -7,8 +7,6 @@ define([ div = document.createElement("div"), input = document.createElement("input"); - input.type = "checkbox"; - // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a>"; @@ -29,15 +27,18 @@ define([ support.html5Clone = document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) + input.type = "checkbox"; + input.checked = true; fragment.appendChild( input ); support.appendChecked = input.checked; + // Make sure textarea (and checkbox) defaultValue is properly cloned + // Support: IE6-IE11+ + div.innerHTML = "<textarea>x</textarea>"; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + // #11217 - WebKit loses check when the name is after the checked attribute fragment.appendChild( div ); div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; |