Closed
Bug 329019
Opened 20 years ago
Closed 20 years ago
ChildNodes returns all sub elements
Categories
(Toolkit Graveyard :: Error Console, defect)
Tracking
(Not tracked)
People
(Reporter: jerome, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Try:
<HTML><BODY>
<table>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<script id="myTable">
alert(document.getElementById('myTable').parentNode.childNodes.length);
</script>
</table>
</BODY></HTML>
IE and Opera will return 5... Mozilla includes the <TD> tags as children of <TABLE> even if they are encased in <TR> tags
Reproducible: Always
Steps to Reproduce:
<HTML><BODY>
<table>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<script id="myTable">
alert(document.getElementById('myTable').parentNode.childNodes.length);
</script>
</table>
</BODY></HTML>
Actual Results:
alerts 9 child nodes
Expected Results:
should alert 5 child nodes
The alert keeps saying 9 when I remove 1, 2, 3 or 4 <td> tags from the code, it says 5 when I write <tr><td>...</tr><script id="myTable"> as one continuous line -> duplicate of/related to Core bug 26179? (Mozilla 1.8b1 and Firefox 1.5.0.1)
Comment 2•20 years ago
|
||
zug_treno: why don't you just resolve the bug? You're right, length is 9 because mozilla also counts the whitespace text nodes.
Comment 3•20 years ago
|
||
*** This bug has been marked as a duplicate of 26179 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
| Assignee | ||
Updated•18 years ago
|
Product: Firefox → Toolkit
| Assignee | ||
Updated•10 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•