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
This commit is contained in:
Dave Methvin 2014-01-22 15:51:20 -08:00
parent 49b03cf702
commit f345291209
2 changed files with 8 additions and 7 deletions

View File

@ -7,8 +7,6 @@ define([
div = document.createElement("div"), div = document.createElement("div"),
input = document.createElement("input"); input = document.createElement("input");
input.type = "checkbox";
// Setup // Setup
div.setAttribute( "className", "t" ); div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a>"; div.innerHTML = " <link/><table></table><a href='/a'>a</a>";
@ -29,15 +27,18 @@ define([
support.html5Clone = support.html5Clone =
document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; 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 // Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7) // value of true after appended to the DOM (IE6/7)
input.type = "checkbox";
input.checked = true;
fragment.appendChild( input ); fragment.appendChild( input );
support.appendChecked = input.checked; 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 // #11217 - WebKit loses check when the name is after the checked attribute
fragment.appendChild( div ); fragment.appendChild( div );
div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; div.innerHTML = "<input type='radio' checked='checked' name='t'/>";

View File

@ -178,7 +178,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"inlineBlockNeedsLayout": false, "inlineBlockNeedsLayout": false,
"input": true, "input": true,
"leadingWhitespace": true, "leadingWhitespace": true,
"noCloneChecked": true, "noCloneChecked": false,
"noCloneEvent": true, "noCloneEvent": true,
"opacity": true, "opacity": true,
"optDisabled": true, "optDisabled": true,