Fix #13818: Add wrapMap entry for col element

This commit is contained in:
Oleg 2013-04-24 22:15:41 +04:00
parent 78c803f1b5
commit 3a6194076b
2 changed files with 16 additions and 1 deletions

View File

@ -16,6 +16,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
option: [ 1, "<select multiple='multiple'>", "</select>" ],
thead: [ 1, "<table>", "</table>" ],
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
@ -25,7 +26,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
// Support: IE 9
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.col = wrapMap.thead;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
jQuery.fn.extend({

View File

@ -2105,3 +2105,17 @@ test( "Make sure specific elements with content created correctly (#13232)", 20,
ok( jQuery.nodeName( this, results[ i ] ) );
});
});
test( "Validate creation of multiple quantities of certain elements (#13818)", 44, function() {
var tags = [ "thead", "tbody", "tfoot", "colgroup", "col", "caption", "tr", "th", "td", "optgroup", "option" ];
jQuery.each( tags, function( index, tag ) {
jQuery( "<" + tag + "/><" + tag + "/>" ).each(function() {
ok( jQuery.nodeName( this, tag ), tag + " empty elements created correctly" );
});
jQuery( "<" + this + "></" + tag + "><" + tag + "></" + tag + ">" ).each(function() {
ok( jQuery.nodeName( this, tag ), tag + " elements with closing tag created correctly" );
});
});
});