blob: 6ace59d0d2e84992e930ae386f7ebfc164133f91 [file] [log] [blame]
hyattfe679e12007-05-24 05:58:11 +00001<html>
2<head>
3<script>
4function print(message, color)
5{
6 var paragraph = document.createElement("div");
7 paragraph.appendChild(document.createTextNode(message));
8 paragraph.style.fontFamily = "monospace";
9 if (color)
10 paragraph.style.color = color;
11 document.getElementById("console").appendChild(paragraph);
12}
13
14function shouldBe(a, b)
15{
16 var evalA;
17 try {
18 evalA = eval(a);
19 } catch(e) {
20 evalA = e;
21 }
22
23 if (evalA == b)
24 print("PASS: " + a + " should be " + b + " and is.", "green");
25 else
26 print("FAIL: " + a + " should be " + b + " but instead is " + evalA + ".", "red");
27}
28
29function test()
30{
rniwa@webkit.org224c8b52012-08-04 01:13:22 +000031 if (window.testRunner)
32 testRunner.dumpAsText();
hyattfe679e12007-05-24 05:58:11 +000033
34 shouldBe("document.getElementById('tr1').parentNode.childNodes.length == 5", true);
35 shouldBe("document.getElementById('tr1').rowIndex == 0", true);
36 shouldBe("document.getElementById('tr2').rowIndex == 1", true);
37 document.getElementById('tr2').parentNode.deleteRow(1);
38 shouldBe("document.getElementById('tr3').rowIndex == 1", true);
39}
40</script>
41</head>
42
43<body onload="test();" style="background: green; color:white">
44
45<p>This page tests whether or not comment nodes disrupt the row index of
46rows in a table.</p>
47
48<table><tr id="tr1"><td>Row One</tr><!-- COMMENT TO TRY TO MESS STUFF UP --><tr id="tr2"><td>Row Two</tr><!-- COMMENT TO TRY TO MESS STUFF UP --><tr id="tr3"><td>Row Three<!-- COMMENT TO TRY TO MESS STUFF UP --></table>
49
50<hr>
51
52<div id='console' style="background-color:white; border:2px solid black"></div>
53
54</body>
55</html>