Closed Bug 131169 Opened 23 years ago Closed 23 years ago

Mozilla treats white-spaces as Text-Nodes

Categories

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

x86
Windows 98
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 26179

People

(Reporter: aceop, Assigned: jst)

Details

I have been told that Mozilla, in opposite to Opera and IE, treats white-spaces such as "space" or CR/LF as text-nodes (like the IE5 for Macintosh also does). Well, people are confused whether this is standard conforming behaviour. I also didn't find anything about how to handle white-spaces, maybe because I didn't search too intensive. Anyway, this piece of code (taken from the famous german HTML documentation selfhtml - with permission) demonstrates the problem: <html><head><title>Test</title> </head><body> <ul id="ersteListe"><li>erster Punkt</li><li>zweiter Punkt</li></ul> <script type="text/javascript"> <!-- var Anzahl = document.getElementById("ersteListe").childNodes.length; document.write("first list: ammount child nodes: <b>" + Anzahl +"<\/b><br>"); //--> </script> <ul id="zweiteListe"> <li>erster Punkt</li> <li>zweiter Punkt</li> </ul> <script type="text/javascript"> <!-- var Anzahl = document.getElementById("zweiteListe").childNodes.length; document.write("second list: ammount child nodes: <b>" + Anzahl +"<\/b><br>"); //--> </script> </body></html> So, if the behaviour of Mozilla is wrong I think that's almost a critical bug. If not, I'd really like to know where it's written down that Mozilla is right. Peter
Probably a dup of bug 26179
Of course we do. Whitespace is text. It affects formatting of the source, and it also affects the DOM's internal structure. *** This bug has been marked as a duplicate of 26179 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
VERIFIED dup.
Status: RESOLVED → VERIFIED
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.