aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2014-01-22 14:50:36 -0800
committerDave Methvin <dave.methvin@gmail.com>2014-01-23 13:04:40 -0500
commita20494228d51c57c454ff9f10a4ba8bbdda0e49c (patch)
treec19061e8cf64c93e9017b875e89592df050db6de
parent3f3f458974fe0bdccfe9042c9503fd2d03e2f6ff (diff)
downloadjquery-a20494228d51c57c454ff9f10a4ba8bbdda0e49c.tar.gz
jquery-a20494228d51c57c454ff9f10a4ba8bbdda0e49c.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
-rw-r--r--src/manipulation/support.js13
-rw-r--r--test/unit/support.js2
2 files changed, 6 insertions, 9 deletions
diff --git a/src/manipulation/support.js b/src/manipulation/support.js
index 9463a01f1..e2ba066ec 100644
--- a/src/manipulation/support.js
+++ b/src/manipulation/support.js
@@ -3,8 +3,7 @@ define([
], function( support ) {
(function() {
- var input,
- fragment = document.createDocumentFragment(),
+ var fragment = document.createDocumentFragment(),
div = fragment.appendChild( document.createElement( "div" ) );
// #11217 - WebKit loses check when the name is after the checked attribute
@@ -14,12 +13,10 @@ define([
// 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;
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ // Support: IE9-IE11+
+ div.innerHTML = "<textarea>x</textarea>";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
})();
return support;
diff --git a/test/unit/support.js b/test/unit/support.js
index efd4f820b..10defc5e9 100644
--- a/test/unit/support.js
+++ b/test/unit/support.js
@@ -92,7 +92,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": false,
"cors": true,
"focusinBubbles": true,
- "noCloneChecked": true,
+ "noCloneChecked": false,
"optDisabled": true,
"optSelected": false,
"pixelPosition": true,