Closed Bug 150981 Opened 24 years ago Closed 21 years ago

CR-Only newlines sometimes ignored in PRE element

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 103833

People

(Reporter: steck, Assigned: harishd)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 BuildID: 2002053012 When an element inside a PRE element contains a newline, it's not always rendered. While the HTML 4.01 spec says PRE rendering can elide whitespace, I don't think whitespace includes newlines. Reproducible: Always Steps to Reproduce: 1.View http://www.ccs.neu.edu/~steck/tmp/moz-pre-bug.html 2.Try the same in IE6 or Netscape 4.7x 3. Actual Results: There's no blank line between the hyperlink rendered on that page and the next line, which begins "discusses ...". Expected Results: I expected a blank line between the hyperlink and the line beginning "discusses ...". Both IE6 and Netscape 4.7x show that blank line. If you do View Source in Mozilla 1.0, the newline just before the closing </tt> tag is missing! Whatever is eliding that newline is probably causing the problem. In IE6 and Netscape 4.7x, View Source clearly show that newline.
WFM: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1a) Gecko/20020610 pi
QA Contact: petersen → moied
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Target Milestone: --- → Future
WFM, win98SE 2002053012 (1.0) and in WinXP 2002070908 trunk. I see the line break in view source, too. reporter, (or anyone else) are you still seeing this?
Mail from the reporter: If you mean the line break after the closing </a> and before the closing </tt>, I don't see it in View Source. Some more info: the file at the URL mentioned has carriage returns (0x0D), not newlines. If I replace those with newlines (0x0A), Mozilla 1.0 (WinXP Pro) displays things as expected. See http://www.ccs.neu.edu/~steck/tmp/moz-pre-bug2.html for that change. [Original URL was the same with the `2' removed.] Note that for the original URL, Mozilla 1.0 rendered most of the carriage returns as line breaks, except the one mentioned above.
Doh! OK, now that you've given me what it's _supposed_ to look like, and I've re-read the original description, I can confirm that I *DO* see the problem in both 1.0 on win98, and trunk 2002070908 trunk winXP. Apologies for being a dolt the first time around... Yes, I imagine it's related to using only CRs for line-ends. Now, LF-Only is the Unix way, CR/LF is the windows way, so where's CR only come from? [goes digging] Ah. Macs, and a few others.
Summary: Newline ignored in PRE element → CR-Only newlines sometimes ignored in PRE element
Parser. The newline is not even making its way into the content model.
Assignee: attinasi → harishd
Component: Layout → Parser
OS: Windows 2000 → All
Priority: P3 → --
QA Contact: moied → dsirnapalli
Hardware: PC → All
Target Milestone: Future → ---
This is the same as bug 103833 (which is fixed in current builds). The testcase certainly works fine in current builds. *** This bug has been marked as a duplicate of 103833 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.