Closed
Bug 89782
Opened 23 years ago
Closed 23 years ago
<td> firstChild is [xpconnect wrapped Text] when line break in HTML
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: murphye, Assigned: jst)
Details
(Keywords: testcase)
<html><body> <table><tr><td id="td"> <p>test</p></tr></table> <script> x = document.getElementById('td'); alert(x.childNodes[0]); //also alert(x.firstChild); </script> </body></html> Note the line break after the <td> Removing this fixes the problem.
Comment 1•23 years ago
|
||
this is simply the way we handle whitespaces in the DOM. all the line breaks after tags are represented as text nodes. For more information please see http://mozilla.org/docs/dom/technote/whitespace/. Probably wontfix or dup of the master wontfix bug.
Reporter | ||
Comment 2•23 years ago
|
||
IE does not do this, and to me it is kinda lame. Just makes things harder to make compatible. There is very rarely (if ever) going to be a scenario where a person expects that line break (after a tag) to actually be displayed as white space in their HTML. Therefore, it should not be in the DOM tree.
Comment 3•23 years ago
|
||
dup of bug 26179 then. *** This bug has been marked as a duplicate of 26179 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•