mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
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:
parent
49b03cf702
commit
f345291209
@ -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'/>";
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user