diff options
author | Leonardo Braga <leonardo.braga@gmail.com> | 2015-01-04 19:02:39 -0500 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-01-13 07:42:59 +0300 |
commit | 85ffc6d973865a031ded170934e0acfc2e97cb11 (patch) | |
tree | 36cc44040f1ce40d6b7ee7161cbc144b3488ace0 /test | |
parent | 534f13025aeb59a7d5893ce62efafa0b066a4934 (diff) | |
download | jquery-85ffc6d973865a031ded170934e0acfc2e97cb11.tar.gz jquery-85ffc6d973865a031ded170934e0acfc2e97cb11.zip |
Manipulation: add support to tag-hyphenated elements
Fixes #1987
Closes gh-1988
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/manipulation.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 12f5d14df..a6936b95b 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -486,6 +486,23 @@ test( "html(String) with HTML5 (Bug #6485)", function() { equal( jQuery("#qunit-fixture").children().children().children().length, 1, "Make sure nested HTML5 elements can hold children." ); }); +test( "html(String) tag-hyphenated elements (Bug #1987)", function() { + + expect( 27 ); + + jQuery.each( "thead tbody tfoot colgroup caption tr th td".split(" "), function( i, name ) { + var j = jQuery("<" + name + "-d></" + name + "-d><" + name + "-d></" + name + "-d>"); + ok( j[0], "Create a tag-hyphenated element" ); + ok( jQuery.nodeName(j[0], name.toUpperCase() + "-D"), "Hyphenated node name" ); + ok( jQuery.nodeName(j[1], name.toUpperCase() + "-D"), "Hyphenated node name" ); + }); + + var j = jQuery("<tr-multiple-hyphens><td-with-hyphen>text</td-with-hyphen></tr-multiple-hyphens>"); + ok( jQuery.nodeName(j[0], "TR-MULTIPLE-HYPHENS"), "Tags with multiple hypens" ); + ok( jQuery.nodeName(j.children()[0], "TD-WITH-HYPHEN"), "Tags with multiple hypens" ); + equal( j.children().text(), "text", "Tags with multple hypens behave normally" ); +}); + test( "IE8 serialization bug", function() { expect( 2 ); |