Closed Bug 263813 Opened 21 years ago Closed 21 years ago

element.parentNode.nextSibling loses all attributes

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 26179

People

(Reporter: mark_fierling, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10 when navigating the DOM tree using element.parentNode.nextSibling all further elements seem to loose all atributes... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>element.parentNode.nextSibling looses all atributes</title> </head> <body> <table border="1"> <form> <tr> <td><INPUT TYPE="checkbox" id="xxx"></td> <td>Name</td> <td>Size</td> <td>Modified</td> </tr> </form> </table> <script type="text/javascript"> CheckBox = document.getElementById("xxx"); document.write("<br>CheckBox.tagName = " + CheckBox.tagName + "<br>CheckBox.parentNode.tagName = " + CheckBox.parentNode.tagName + "<br>CheckBox.parentNode.nextSibling.tagName = " + CheckBox.parentNode.nextSibling.tagName); </script> </body> </html> the result of this html should output the following below the table: CheckBox.tagName = INPUT CheckBox.parentNode.tagName = TD CheckBox.parentNode.nextSibling.tagName = TD however instead it looks like this: CheckBox.tagName = INPUT CheckBox.parentNode.tagName = TD CheckBox.parentNode.nextSibling.tagName = undefined it works in IE - haven't tested it in any other browsers Reproducible: Always Steps to Reproduce: 1. create new html file using the above html code 2. load file in Mozilla/FireFox 3. observe wrong behaviour Actual Results: output below the table: CheckBox.tagName = INPUT CheckBox.parentNode.tagName = TD CheckBox.parentNode.nextSibling.tagName = undefined Expected Results: output below the table: CheckBox.tagName = INPUT CheckBox.parentNode.tagName = TD CheckBox.parentNode.nextSibling.tagName = TD
Keywords: testcase
Summary: element.parentNode.nextSibling looses all atributes → element.parentNode.nextSibling loses all attributes
There's a textnode between the two TD's. See http://www.mozilla.org/docs/dom/technote/whitespace/ and bug 26179. *** This bug has been marked as a duplicate of 26179 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: