blob: 1385b8c901e10e3a587ee7f72a44ab398de18826 [file] [log] [blame]
* Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
* @description
import "dart:html";
import "../../../../Utils/expect.dart";
import "../../../testcommon.dart";
main() {
var style = new Element.html('''
table {
display: none;
''', treeSanitizer: new NullTreeSanitizer());
<h3>HTMLTableElement's insertRow() method</h3>
<h4>The first three test whether HTMLTableElement's insertRow() method can add an implicit tbody into a table without one, to hold the inserted row.</h4>
<p>The first tests an empty table</p>
<p>The second tests a table with text contents.</p>
<p>The third tests a table with only a form element inside.</p>
<h4>The next four test the method on typical cases.</h4>
<p>The first tests a table with only a thead</p>
<p>The second tests a table with only a tbody</p>
<p>The third tests a table with only a tfoot</p>
<p>The fourth tests a table with a few rows and cells</p>
<table> </table>
<table id="table7" width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#cccccc" style="border-top: 1px #999999 solid; border-bottom: 5px #000000 solid">
<td valign="middle" nowrap style="border-bottom: 2px #999999 solid" width="100%"><font face="arial, sans-serif" size="-2"><a href="" title="OSTG - The Open Source Technology Group" style="text-decoration:none"><font face="verdana" color="#001670">&nbsp;<b>OSTG</b></font></a>&nbsp;|&nbsp;<a href="" style="text-decoration: none">SourceForge</a> -&nbsp;<a href="" style="text-decoration: none">ThinkGeek</a> -&nbsp;<a href="" style="text-decoration: none">ITMJ</a> -&nbsp;<a href="" style="text-decoration: none"></a> -&nbsp;<a href="" style="text-decoration: none">NewsForge</a> -&nbsp;<a href="" style="text-decoration: none">freshmeat</a> -&nbsp;<a href="" style="text-decoration: none">Newsletters</a> -&nbsp;<a href="" style="text-decoration: none">Jobs</a> -&nbsp;<a href="" style="text-decoration: none">Broadband</a> -&nbsp;<a href="" style="text-decoration: none">Whitepapers</a></font></td><td valign="middle" style="display:hidden; border-bottom: 2px solid #999999" nowrap><b><A HREF="//;opt_osdn_navbar=0" style="text-decoration: none;"><font size="-2" face="verdana" color="#666666">&nbsp;X&nbsp;</font></a></b>
<ol id="console"></ol>
''', treeSanitizer: new NullTreeSanitizer());
insert(table) {
var insertedRow = table.insertRow(-1);
// Check that the insertedRow is in the table and that the table now has at least one tBody
debug('in table');
shouldBe(table.tBodies.length > 0);
var tables = document.getElementsByTagName("table");
for(var i = 0; tables[i]; i++)