| function print(message, color) |
| var paragraph = document.createElement("div"); |
| paragraph.appendChild(document.createTextNode(message)); |
| paragraph.style.fontFamily = "monospace"; |
| paragraph.style.color = color; |
| document.getElementById("console").appendChild(paragraph); |
| print("PASS: " + a + " should be " + b + " and is.", "green"); |
| print("FAIL: " + a + " should be " + b + " but instead is " + evalA + ".", "red"); |
| shouldBe("document.getElementById('tr1').parentNode.childNodes.length == 5", true); |
| shouldBe("document.getElementById('tr1').rowIndex == 0", true); |
| shouldBe("document.getElementById('tr2').rowIndex == 1", true); |
| document.getElementById('tr2').parentNode.deleteRow(1); |
| shouldBe("document.getElementById('tr3').rowIndex == 1", true); |
| <body onload="test();" style="background: green; color:white"> |
| <p>This page tests whether or not comment nodes disrupt the row index of |
| <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> |
| <div id='console' style="background-color:white; border:2px solid black"></div> |