Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / tables / mozilla / other / move_row.html
blobf517c911176bd1655e0988448d3893227ed0e479
1 <html>
2 <script>
3 function moveRow(from, to)
5 if (from == -1 && to == -1)
7 var fromE = document.getElementsByTagName("INPUT")[0];
8 from = parseInt(fromE.value);
9 var toE = document.getElementsByTagName("INPUT")[1];
10 to = parseInt(toE.value);
12 var row = document.getElementsByTagName("TR")[from];
13 row.rowIndex = to;
15 function runTests()
17 // Test fails if final ordering differs from initial ordering
19 // Starting with order 0,1,2,3,4,5 shift through the rows and
20 // end up back where we started.
21 moveRow(0, 5);
22 moveRow(1, 4);
23 moveRow(2, 3);
24 moveRow(3, 2);
25 moveRow(4, 1);
26 moveRow(5, 0);
28 // Throw 2 out-of-bounds tests at the end and still get back to the starting point.
29 moveRow(5, -1);
30 moveRow(0, 6);
32 function delay()
34 setTimeout("runTests()", 9);
36 </script>
37 <body bgcolor=white onload="delay()">
38 <table>
39 <tr><td>Row 0</td></tr>
40 <tr><td>Row 1</td></tr>
41 <tr><td>Row 2</td></tr>
42 <tr><td>Row 3</td></tr>
43 <tr><td>Row 4</td></tr>
44 <tr><td>Row 5</td></tr>
45 </table>
46 <input type=text name=from value=2 size=1>
47 <input type=text name=to value=4 size=1>
48 <input type=button name=go value=go onclick="moveRow(-1,-1);">
49 </body>
50 </html>