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)

x86
Windows 2000
defect
Not set
critical

Tracking

()

VERIFIED DUPLICATE of bug 26179

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.
Severity: normal → critical
Keywords: testcase
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.
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.
dup of bug 26179 then.


*** This bug has been marked as a duplicate of 26179 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
verified as dup of 26179
Status: RESOLVED → VERIFIED
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.