Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/insert-row.html

Issue 2785963002: Move tests for table elements to LayoutTests/html/tabular_data/. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script>
4 function print(message)
5 {
6 var paragraph = document.createElement("li");
7 paragraph.appendChild(document.createTextNode(message));
8 document.getElementById("console").appendChild(paragraph);
9 }
10 function isInCollection(collection, item) {
11 for(var i = 0; i < collection.length; i++)
12 if(collection[i] == item)
13 return true;
14
15 return false;
16 }
17 function insert(table) {
18 try {
19 var insertedRow = table.insertRow(-1);
20 var error;
21 // Check that the insertedRow is in the table and that the table now has at least one tBody
22 if(!isInCollection(table.rows, insertedRow)) {
23 print("Failed: Inserted row not found inside table"); return ;
24 }
25 if(table.tBodies.length == 0 && !table.tFoot && !table.tHead) {
26 print("Failed: Inserted row did not add an implicit tbody/tf oot/thead"); return;
27 }
28
29 print("Success");
30 }
31 catch(e) {
32 print("Failed: " + e);
33
34 }
35 }
36 function test()
37 {
38 if (window.testRunner)
39 testRunner.dumpAsText();
40
41 var tables = document.getElementsByTagName("table");
42 for(var i = 0; tables[i]; i++)
43 insert(tables[i]);
44
45 }
46
47 </script>
48 <style>
49 table {
50 display: none;
51 }
52 </style>
53 </head>
54 <body onload="test();">
55 <h3>HTMLTableElement's insertRow() method</h3>
56 <h4>The first three test whether HTMLTableElement's insertRow() method c an add an implicit tbody into a table without one, to hold the inserted row.</h4 >
57 <p>The first tests an empty table</p>
58 <p>The second tests a table with text contents.</p>
59 <p>The third tests a table with only a form element inside.</p>
60 <h4>The next four test the method on typical cases.</h4>
61 <p>The first tests a table with only a thead</p>
62 <p>The second tests a table with only a tbody</p>
63 <p>The third tests a table with only a tfoot</p>
64 <p>The fourth tests a table with a few rows and cells</p>
65 <table></table>
66 <table> </table>
67 <table><form></form></table>
68 <table><thead></thead></table>
69 <table><tbody></tbody></table>
70 <table><tfoot></tfoot></table>
71 <table id="table7" width="100%" border="0" cellpadding="2" cellspacing=" 0" bgcolor="#cccccc" style="border-top: 1px #999999 solid; border-bottom: 5px #0 00000 solid">
72 <tr>
73 <td valign="middle" nowrap style="border-bottom: 2px #999999 solid" width="100%"><font face="arial, sans-serif" size="-2"><a href="http://www.ostg. com" 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="http://sf.net" style="text-decoration: none">SourceForge</a> -&nbsp;<a href="http://thinkgeek.com" style="text-decoration: none">ThinkGeek</a> -&nbsp;< a href="http://slashdot.org/relocate.pl?id=12076d9d1d102290bbd8d6c328d9352d" sty le="text-decoration: none">ITMJ</a> -&nbsp;<a href="http://linux.com" style="te xt-decoration: none">Linux.com</a> -&nbsp;<a href="http://newsforge.com" style=" text-decoration: none">NewsForge</a> -&nbsp;<a href="http://freshmeat.net" style ="text-decoration: none">freshmeat</a> -&nbsp;<a href="http://newsletters.ostg.c om" style="text-decoration: none">Newsletters</a> -&nbsp;<a href="http://slashdo t.org/relocate.pl?id=0bd85aa57f4ab88f2d01c33b548b693c" style="text-decoration: n one">Jobs</a> -&nbsp;<a href="http://slashdot.org/relocate.pl?id=776713765547209 fc2c05a83454efda2" style="text-decoration: none">Broadband</a> -&nbsp;<a href="h ttp://slashdot.org/relocate.pl?id=237ae3c6bbb4992f4144befc67856103" style="text- decoration: none">Whitepapers</a></font></td><td valign="middle" style="display: hidden; border-bottom: 2px solid #999999" nowrap><b><A HREF="//slashdot.org/user s.pl?op=savemiscopts&amp;opt_osdn_navbar=0" style="text-decoration: none;"><font size="-2" face="verdana" color="#666666">&nbsp;X&nbsp;</font></a></b>
74 </td>
75 </tr>
76 </table>
77
78 <hr>
79 <ol id="console"></ol>
80 </body>
81 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698