Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / table / rowindex-comment-nodes.html
blob6ace59d0d2e84992e930ae386f7ebfc164133f91
1 <html>
2 <head>
3 <script>
4 function print(message, color)
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);
14 function shouldBe(a, b)
16 var evalA;
17 try {
18 evalA = eval(a);
19 } catch(e) {
20 evalA = e;
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");
29 function test()
31 if (window.testRunner)
32 testRunner.dumpAsText();
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);
40 </script>
41 </head>
43 <body onload="test();" style="background: green; color:white">
45 <p>This page tests whether or not comment nodes disrupt the row index of
46 rows in a table.</p>
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>
50 <hr>
52 <div id='console' style="background-color:white; border:2px solid black"></div>
54 </body>
55 </html>