I have an example for which Env.js produces an incorrect DOM for an
HTML table nested within another table. The row(s) in the nested table
appear in the rows attribute of the containing table. The example
below has a table with 3 rows, the last of which contains another
table with a single row. Inspecting the DOM in Env.js indicates the
outer table has four rows, the fourth one appears to reference the
same node as the inner nested table.
HTML (saved as C:\temp\test.html)
<html>
<head><title>Test document</title></head>
<body>
<table>
<tr><td>Cell 1, Row 1</td><td>Cell 2, Row 1</td></tr>
<tr><td>Cell 1, Row 2</td></tr>
<tr>
<td>Cell 1 Row 3
<table>
<tr><td>Inner table, Cell1, Row 1</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Env.js transcript:
js> load("env.rhino.1.2.js")
[ Envjs/1.6 (Rhino; U; Windows XP x86 5.1; en-US; rv:1.7.0.rc2) Resig/
20070309 PilotFish/1.2.13 ]
js> window.location = "file:///c:/temp/test.html";
file:///c:/temp/test.html
js> tables = document.getElementsByTagName('table')
[object NodeList]
js> tables.length
2
js> tables[0].rows.length
4
js> tables[1].rows.length
1
js> tables[0].rows[2].outerHTML
<tr>
<td>Cell 1 Row 3
<table>
<tbody><tr><td>Inner table, Cell1, Row 1</td></tr>
</tbody></table>
</td>
</tr>
js> tables[0].rows[3].outerHTML
<tr><td>Inner table, Cell1, Row 1</td></tr>
js> tables[1].rows[0].outerHTML
<tr><td>Inner table, Cell1, Row 1</td></tr>
js> tables[0].rows[3] === tables[1].rows[0]
true
js>