From: Michał Gołębiowski-Owczarek Date: Mon, 30 Mar 2020 18:15:09 +0000 (+0200) Subject: Manipulation: Skip the select wrapper for "; + support.option = !!div.lastChild; } )(); return support; diff --git a/src/manipulation/wrapMap.js b/src/manipulation/wrapMap.js index 1f446f7d7..da48bf9fe 100644 --- a/src/manipulation/wrapMap.js +++ b/src/manipulation/wrapMap.js @@ -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, "" ], - // XHTML parsers do not magically insert elements in the // same way that tag soup parsers do. So we cannot shorten // this by omitting 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, "" ]; +} + return wrapMap; } ); diff --git a/test/unit/support.js b/test/unit/support.js index e293c7423..dde4e4197 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -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,