Add comments for optgroup and option elements in wrapMap

Add tests for optgroup element
This commit is contained in:
Oleg 2012-12-28 18:56:29 +04:00
parent f193acf3a1
commit d3d8ed443c
2 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,8 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
wrapMap = {
// Support: IE 9
option: [ 1, "<select multiple='multiple'>" ],
legend: [ 1, "<fieldset>" ],
param: [ 1, "<object>" ],
@ -19,6 +21,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
_default: [ 0, "" ]
};
// Support: IE 9
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;

View File

@ -395,7 +395,7 @@ var testAppendForObject = function( valueObj, isFragment ) {
var testAppend = function( valueObj ) {
expect( 61 );
expect( 63 );
testAppendForObject( valueObj, false );
testAppendForObject( valueObj, true );
@ -454,6 +454,10 @@ var testAppend = function( valueObj ) {
jQuery("#select1").append( valueObj("<OPTION>Test</OPTION>") );
equal( jQuery("#select1 option:last").text(), "Test", "Appending OPTION (all caps)" );
jQuery("#select1").append( valueObj("<optgroup label='optgroup'><option>optgroup</option></optgroup>") );
equal( jQuery("#select1 optgroup").attr("label"), "optgroup", "Label attribute in newly inserted optgroup is correct" );
equal( jQuery("#select1 option:last").text(), "optgroup", "Appending optgroup" );
jQuery("#table").append( valueObj("<colgroup></colgroup>") );
equal( jQuery("#table colgroup").length, 1, "Append colgroup" );