Closed Bug 28598 Opened 25 years ago Closed 24 years ago

"\r" doesn't produce a line break!

Categories

(Core :: Layout: Form Controls, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: ullmi, Assigned: akkzilla)

Details

(Keywords: testcase)

Attachments

(1 file)

Hi,
I've found out that "\r" doesn't produce a line break in a JS text as it is supposed to do.
NN 4.x and IE both do produce a line break.

Test case: http://www.datacomm.ch/ullmann/
When you move the mouse over one of the eight red buttons, the content of the textarea changes. In the textarea, there should be a line break after the capitalized title at the top of the area.
DOM0.
Assignee: rogerl → vidur
Component: Javascript Engine → DOM Level 0
QA Contact: rginda → desale
Dosn't work on a Win98 mashine so I'm marking it crossplatform and confirming

I also think that this is a HTML-Forms problem rather then a DOM problem since
it seems that the \r actually gets into the textarea but it is displayed as a
unknown char rather then a newline.
Assignee: vidur → rods
Component: DOM Level 0 → HTML Form Controls
OS: Mac System 8.6 → All
QA Contact: desale → ckritzer
Hardware: Macintosh → All
Couldn't confirm and reassign to component owner at the same time :(

This was confirmed with build 2000-03-23-08 on Win98SE btw.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Buster, textarea issue
Assignee: rods → buster
akkana, you were working on newline issues in text controls, weren't you?
Assignee: buster → akkana
Currently, we're removing returns because it's an illegal character in the DOM.

I can make it so that any of \r, \r\n, or \n is turned into a single \n.

Cc'ing pollmann since he has a bug to add this sort of filtering to other form
elements, and we should coordinate and make sure we do the same thing
everywhere.  (Eric, should we have a utility routine like ConvertReturns that
all our
form elements can call, so we don't have to rewrite this code many times?)
Status: NEW → ASSIGNED
Sounds like a good plan to me.  A decent place to put this is in
nsFormControlHelper
Target Milestone: --- → M16
Okay, nsFormControlHelper it is.  I've checked this in, and I'm typing this on
windows mozilla to test it.
This is a new line, for testing.
This is another new line.
*** Bug 29677 has been marked as a duplicate of this bug. ***
The fix I was testing when I made that last comment seemed to have made bugzilla
happier, but didn't solve the test case in this bug.  Turns out that
nsGfxTextControlFrame was doing its linebreak conversion at the wrong time (at
least for this case).  I've just checked in a fix which should fix this case as
well.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
This works now for both my testcase and the original url. Nice work!

Verifying
Status: RESOLVED → VERIFIED
Well done!
Line breaks seem to work correctly now.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: