Closed Bug 117617 Opened 24 years ago Closed 22 years ago

innerHTML looses newlines

Categories

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

PowerPC
All
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: georg, Unassigned)

References

()

Details

Attachments

(4 files)

The getter part of the innerHTML implementation sometimes looses some newline characters. I don't know the conditions which trigger this bug, but there is a sample page on the web, where you can see the bug. Because thes page tests for the bug before doing any modifications the parts, where the bug aoccures are not modified. In this sample the realted Elements are PRE tags. Without modifying them the newlines are present, but when reading from innerHTML they go lost. So the bug must be in the getter part of innerHTML. On following page innerHTML fails 2 times: http://gml-modul.sourceforge.net/cgi-bin/gmL?domain=dhtml-tutorial&webpage=22 The parts, where the bug occures are marked with a bug icon. This bug was also observed on the old implementation, which used IFRAME tags instead of PRE tags with server side inclusion of the content. This bug is also present in Mozilla 0.9.7
Hm, sounds really like a duplicate of bug 89780. In my case the LF characters are dropped. There are no CR characters to drop, because the files are created on a Linux system. I don't know what would happen, if line termination is done with CR LF, because neither my old Mac editors nor my old Linux editors support that format.
So Georg, to dup or not to dup, that is the question :-)
Confirming, but adding dependency...
Status: UNCONFIRMED → NEW
Depends on: 89780
Ever confirmed: true
QA Contact: lchiang → ian
testcase?
Attached file The testcase
If the bug is fixed, then the stylesheet sample code should be colored (syntax hiliting).
With this build the testcase works well: Mozilla 1.2b Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021030
With this one it works well too Mozilla 1.3a Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021123
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
Marking WFM per Reporters comment.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
This bug isn't resolved. I'm attaching a test case to illustrate. Since the behavior is completely different, I don't think this is a dupe of 89780, though it may be related.
Create a <select> control and add newline-separated text to it via document.write(). Compare the control's innerHTML to the content that was written into the document.
Create a <select> control and add newline-separated text to it via document.write(). Compare the control's innerHTML to the content that was written into the document.
Create a <select> control and add newline-separated text to it via document.write(). Compare the control's innerHTML to the content that was written into the document.
Argh...sorry for the spam. See also bug #100175.
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: