]> source.dussan.org Git - jquery.git/commitdiff
Append colgroup and col elements (#1044)
authorBrandon Aaron <brandon.aaron@gmail.com>
Mon, 30 Apr 2007 01:43:52 +0000 (01:43 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Mon, 30 Apr 2007 01:43:52 +0000 (01:43 +0000)
src/jquery/coreTest.js
src/jquery/jquery.js

index 479bed0f027ff0a0b458e8873e8af88c6eeaf8e3..d829d3092a67382a7307bd74301fe29d8990b60d 100644 (file)
@@ -356,7 +356,7 @@ test("wrap(String|Element)", function() {
 });
 
 test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
-       expect(14);
+       expect(16);
        var defaultText = 'Try them out:'
        var result = $('#first').append('<b>buga</b>');
        ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
@@ -412,6 +412,11 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
        $('#select1').append('<OPTION>Test</OPTION>');
        ok( $('#select1 option:last').text() == "Test", "Appending &lt;OPTION&gt; (all caps)" );
        
+       $('#table').append('<colgroup></colgroup>');
+       ok( $('#table colgroup').length, "Append colgroup" );
+       
+       $('#table colgroup').append('<col>');
+       ok( $('#table colgroup col').length, "Append col" );
 });
 
 test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
index d04aa6199a0ec381b72f8420f78d556566db60ac..c22c12c6159614fe1e50ba835a4f8ca821ce2054 100644 (file)
@@ -1465,7 +1465,7 @@ jQuery.extend({
                                        !s.indexOf("<leg") &&
                                        [1, "<fieldset>", "</fieldset>"] ||
                                        
-                                       (!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot")) &&
+                                       (!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot") || !s.indexOf("<colg")) &&
                                        [1, "<table>", "</table>"] ||
                                        
                                        !s.indexOf("<tr") &&
@@ -1475,6 +1475,9 @@ jQuery.extend({
                                        (!s.indexOf("<td") || !s.indexOf("<th")) &&
                                        [3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
                                        
+                                       !s.indexOf("<col") &&
+                                       [2, "<table><colgroup>", "</colgroup></table>"] ||
+                                       
                                        [0,"",""];
 
                                // Go to html and back, then peel off extra wrappers