Skip to content
Permalink
Browse files
Manipulation: Skip the select wrapper for <option> outside of IE 9
Closes gh-4647
  • Loading branch information
mgol committed Mar 30, 2020
1 parent 1d61fd9 commit 966a70909019aa09632c87c0002c522fa4a1e30e
Showing 3 changed files with 27 additions and 7 deletions.
@@ -28,6 +28,12 @@ define( [
// Make sure textarea (and checkbox) defaultValue is properly cloned
div.innerHTML = "<textarea>x</textarea>";
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;

// Support: IE <=9 only
// IE <=9 replaces <option> tags with their contents when inserted outside of
// the select element.
div.innerHTML = "<option></option>";
support.option = !!div.lastChild;
} )();

return support;
@@ -1,13 +1,12 @@
define( function() {
define( [
"./support"
], function( support ) {

"use strict";

// We have to close these tags to support XHTML (#13200)
var wrapMap = {

// Support: IE <=9 only
option: [ 1, "<select multiple='multiple'>", "</select>" ],

// XHTML parsers do not magically insert elements in the
// same way that tag soup parsers do. So we cannot shorten
// this by omitting <tbody> or other required elements.
@@ -19,11 +18,13 @@ var wrapMap = {
_default: [ 0, "", "" ]
};

// Support: IE <=9 only
wrapMap.optgroup = wrapMap.option;

wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;

// Support: IE <=9 only
if ( !support.option ) {
wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
}

return wrapMap;
} );
@@ -68,6 +68,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": true,
"pixelPosition": true,
@@ -86,6 +87,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": true,
"noCloneChecked": false,
"option": true,
"optSelected": false,
"pixelBoxStyles": true,
"pixelPosition": true,
@@ -104,6 +106,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": true,
"noCloneChecked": false,
"option": false,
"optSelected": false,
"pixelBoxStyles": true,
"pixelPosition": true,
@@ -122,6 +125,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": true,
"pixelPosition": true,
@@ -140,6 +144,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": true,
"pixelPosition": true,
@@ -158,6 +163,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": false,
"pixelPosition": false,
@@ -176,6 +182,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": true,
"pixelPosition": true,
@@ -194,6 +201,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": true,
"pixelPosition": true,
@@ -212,6 +220,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": true,
"pixelPosition": true,
@@ -230,6 +239,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": false,
"pixelPosition": false,
@@ -248,6 +258,7 @@ testIframe(
"createHTMLDocument": false,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": false,
"pixelPosition": false,
@@ -266,6 +277,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": false,
"pixelPosition": false,
@@ -284,6 +296,7 @@ testIframe(
"createHTMLDocument": true,
"focusin": false,
"noCloneChecked": true,
"option": true,
"optSelected": true,
"pixelBoxStyles": false,
"pixelPosition": false,

0 comments on commit 966a709

Please sign in to comment.