Closed
Bug 74091
Opened 23 years ago
Closed 22 years ago
TEXTAREA loses soft returns on back button. [form sub]
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.1alpha
People
(Reporter: donguana, Assigned: john)
References
Details
(Keywords: testcase, Whiteboard: [FIX])
Attachments
(4 files)
221 bytes,
text/html
|
Details | |
956 bytes,
text/html
|
Details | |
21.18 KB,
patch
|
rods
:
review+
attinasi
:
superreview+
|
Details | Diff | Splinter Review |
862 bytes,
patch
|
dbaron
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
I've notice a small glitch with the textarea element in the forms. If you create a form using something like the HTML code below: <FORM METHOD="POST" ACTION="anything.cgi"> <TEXTAREA NAME="ANYTHING" ROWS="7" COLS="50" WRAP="HARD"></TEXTAREA> <INPUT TYPE="SUBMIT"> </FORM> Then you enter some data in the form. Enter enough data so that the textarea box does soft returns. Now when the form is submitted the data is sent with hard returns as it should. But now if I hit the back button to get the form on the window again (so I can continue editing) all the soft returns within the form have now changed to hard returns. Maybe this is the way the system was designed to work, but I don't think it should be this way. To me if I go back, the form should contain the exact same data as it did before I hit submit. I noticed that this bug exist on Netscape 4.76 and on mozilla browsers but does not exist on IE 5.5. It is more are an annoyance than anything. Here is a step by step sample. * Create the form as mentioned above. * Enter the information below as one line to let the window do soft returns. When reporting a bug about page handling, it is recommended that you test the problem isn't an intentional difference between the modes. * Now type "Hello world" before the word "problem" * You should notice that the text is still in soft returns. * Now submit the form and then click on the back button. * The data should still be in the box. * Now enter "Another Word" before "Hello". * You should notice that is now a hard return after the word "problem"
Comment 1•23 years ago
|
||
cc Joe in case he knows anything about this bug.
Comment 4•23 years ago
|
||
confirmed Win2K 20010607, 0.9.1 branch
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 5•23 years ago
|
||
Mass move of form submission bugs, Eric, I am sorry I don't have more time to look at these closer.
Assignee: rods → pollmann
Updated•23 years ago
|
Summary: TEXTAREA loses soft returns on back button. → TEXTAREA loses soft returns on back button. [form sub]
Comment 7•23 years ago
|
||
The bug is sill here on 2001-10-23-09-trunk...
Assignee | ||
Comment 9•23 years ago
|
||
This is totally form controls, and will probably be fixed when bug 112430 is ... the problem is the way we're using the serializer--we just have to flip a bit somewhere that says not to make the wraps happen when we're about to store the value. In that bug we're going to be touching that code directly anyway.
Assignee | ||
Updated•23 years ago
|
Target Milestone: Future → mozilla1.0
Assignee | ||
Comment 11•22 years ago
|
||
I keep meaning to nominate this. This is an incredibly annoying bug for me when using Mozilla.
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 13•22 years ago
|
||
A related problem, which I am uploading now, is that JS shows hard returns even though it should not (at least IE does not, and it seem to me they are right--wrap=hard is essentially unformatted until submission).
Assignee | ||
Comment 14•22 years ago
|
||
This patch fixes the problem by adding an interface to nsGfxTextControlFrame2 to allow content to grab the value either with or without wrapping. Content will grab it without wrapping in all cases now except submission. To keep everything else the same, all frames do as they did before and grab the value with wrapping. This has been tested with Bugzilla and with the testcase provided. wrap=hard submits with wrapping but does not appear to be wrapped for JS or for save/restore. Glory be! This patch also consolidates GetPrimaryFrame(), which was being done in multiple places. Everything is tested and still works (I tested image.naturalHeight). I would have liked to consolidate body.bgColor, but a bug there prevented testing (there *is* no primary frame) so I left it the same and added a comment.
Assignee | ||
Comment 15•22 years ago
|
||
So the preceding patch works, and I am writing this comment with the patched build to prove it. The patch was uploaded with the patched build, of course, but that has wrap=soft. save/restore works beautifully.
Comment 16•22 years ago
|
||
Comment on attachment 83468 [details] [diff] [review] Patch make sure you test Printing and PP r=rods
Attachment #83468 -
Flags: review+
Assignee | ||
Updated•22 years ago
|
Whiteboard: [FIX]
Comment 17•22 years ago
|
||
Comment on attachment 83468 [details] [diff] [review] Patch sr=attinasi
Attachment #83468 -
Flags: superreview+
Assignee | ||
Comment 18•22 years ago
|
||
Checked in to trunk.
Assignee | ||
Comment 19•22 years ago
|
||
(marking fixed)
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 20•22 years ago
|
||
Argh! This caused bug 145741, there isn't always a frame available for all elements, we're now calling GetPrimaryFrameFor() and then calling CallQueryInterface() on the result in at least two places w/o checking if we found a frame or not! CallQueryInterface() is NOT null safe! I'll fix bug 145741, but someone should add null ptr protection in nsHTMLTextAreaElement.cpp too. Reopening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 21•22 years ago
|
||
My bad, I keep thinking do_QueryInterface and CallQueryInterface are functionally the same thing, which they are not.
Assignee | ||
Comment 22•22 years ago
|
||
BTW, looking at the patch, there are no other places where I introduced this.
Comment on attachment 84299 [details] [diff] [review] CallQueryInterface brown bag fix This looks like it will also fix the crash I'm seeing when submitting after using "Edit Attachment as Comment" in bugzilla. In any case, r=dbaron.
Attachment #84299 -
Flags: review+
Assignee | ||
Updated•22 years ago
|
Status: REOPENED → ASSIGNED
Comment 24•22 years ago
|
||
Comment on attachment 84299 [details] [diff] [review] CallQueryInterface brown bag fix sr=jst nsHTMLImageElement::GetImageFrame() (bug 145741) and the one you just fixed were the two places where CallQueryInterface() could be called on a null pointer IIRC.
Attachment #84299 -
Flags: superreview+
Assignee | ||
Comment 25•22 years ago
|
||
Yet Another Fix Checked In.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago → 22 years ago
Resolution: --- → FIXED
Comment 26•22 years ago
|
||
Verifying on build 2002-07-03-10-trunk on windows 98
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•