Closed
Bug 50633
Opened 24 years ago
Closed 22 years ago
textarea always does a soft wrap, even with wrap="off" or white-space:nowrap or white-space:pre
Categories
(Core :: Layout: Form Controls, defect, P3)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
Future
People
(Reporter: anthony, Assigned: kinmoz)
References
(Blocks 1 open bug)
Details
(4 keywords, Whiteboard: [CSS1-5.6.2])
Attachments
(8 files, 5 obsolete files)
It seems that textarea always does a soft wrap, even with wrap="off" set. My understanding is that in this case, the textarea widget should get a horizontal scrollbar, and not do line wrapping. Certainly this is how all other browsers I can find behave. I can't seem to get Mozilla to display a horizontal scrollbar at all. It seems like this has always been the case - but until now the textarea's not been useful enough for Zope work to make me notice this.
Comment 2•24 years ago
|
||
will need to future this one, we will address this next time around
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: helpwanted
Target Milestone: --- → Future
Reporter | ||
Comment 4•24 years ago
|
||
Ok, it looks like this is not going to be as hard as I thought. It seems like it's the textarea's COLS attribute that forces the bogus word wrapping behaviour. I'll try to attach an example, but if bugzilla hates me, it's also available at http://www.zope.org/Members/anthony/tests/mozilla/textarea Note the various tests show fairly conclusively that the 'WRAP' is being overridden by the "cols" setting. Even in the "wrap = soft" and "wrap = hard" cases, unless the "cols" attribute is also set, it has no effect. I'm going to dig into the code a bit, but I've not looked anywhere near this code yet, so it's going to be ugly. Pointers are welcome. (I'd also question the milestone 'future' - it seems like this is a fairly fundamental thing to make textareas useful...?)
Reporter | ||
Comment 5•24 years ago
|
||
Comment 6•24 years ago
|
||
I will reassign it to kin, since he is most familiar with textareas, kin please readjust milestone as appropriate.
Assignee: beppe → kin
Status: ASSIGNED → NEW
Comment 10•23 years ago
|
||
OK... this happens not only with wrap="off" but also with white-space:pre and white-space:nowrap. Adding keywords, about to attach a testcase.
OS: Linux → All
Hardware: PC → All
Summary: textarea always does a soft wrap, even with wrap="off" → textarea always does a soft wrap, even with wrap="off" or white-space:nowrap or white-space:pre
Comment 11•23 years ago
|
||
Comment 12•23 years ago
|
||
This bug is a serious catfood issue for me. I post to newsgroup forums through an interface that uses <textarea name=bd wrap=hard rows=11 cols=65></textarea>. When I use Mozilla to post to the newsgroup, it looks like a maniac wrote the message because of the bizarre line wraps.
Comment 13•23 years ago
|
||
This is also serious for me, as it ruins the design of my pages which have HTML code in a text area. Can you imagine coding with wordwrap turned on?
Comment 14•23 years ago
|
||
The problem seems to be in nsGfxTextControlFrame2::CreateAnonymousContent -- PRInt32 col =-1; if (!(colAttr.GetUnit() == eHTMLUnit_Null)) { col = ((colAttr.GetUnit() == eHTMLUnit_Pixel) ? colAttr.GetPixelValue() : colAttr.GetIntValue()); col = (col <= 0) ? 1 : col; // XXX why a default of 1 char, why hide it } textEditor->SetWrapWidth(col); nsPlaintextEditor::SetWrapWidth sets "white-space: -moz-pre-wrap" if col is greater than zero. If it is /less/ than zero (as it would be if there was no col attribute), then it sets "white-space: pre".
Comment 15•23 years ago
|
||
Comment 16•23 years ago
|
||
i am having trouble with the opposite. Mozilla 0.9.1 doesn't wrap textarea text if no COLS info is given. i wanted to completely format my TEXTAREAS with CSS, that's why i didn't use COLS/ROWS. see the attachment i created. it can also be found at @ http://www.phillipoertel.com/temp/moz/textarea_testing_mozilla.html size and font for TEXTAREAS are specified via CSS. NOTE: Opera 5.11 and IE5.5 wrap in all of the 4 cases shown hope this isn't to confusing and i didn't get too confused ;-) phil!
Comment 17•23 years ago
|
||
Note that ROWS and COLS are required attributes for valid HTML 4.01. Also, the behavior I see in textareas is wrong in that no matter what you set the WRAP attribute to, it will always come back as WRAP="soft" - with one exception, if you enter a long line into the textbox (longer than the number of columns with fixed-width fonts) it will mysteriously transform into a WRAP="off" textbox for that one line and start wrapping again later. The expected behavior in such a case is for the long line to be visually broken into two lines, but still be submitted as one line. Of course none of this wrapping should be occurring when WRAP is turned off. Right now textarea wrapping is severely broken and I would be ashamed to see another Netscape release with this bug.
Keywords: nsCatFood
Comment 18•23 years ago
|
||
I see this still happening in build id : 2001-08-02-10-trunk window2000
Comment 19•23 years ago
|
||
*** Bug 94166 has been marked as a duplicate of this bug. ***
Comment 20•23 years ago
|
||
*** Bug 98902 has been marked as a duplicate of this bug. ***
Comment 21•23 years ago
|
||
I see two cases: 1. With no COLS, TEXTAREA never wraps 2. With COLS, TEXTAREA always wraps I can't tell whether the wrap is hard or soft in case 2 (this bit might actually work as it is not a display issue).
Comment 22•23 years ago
|
||
*** Bug 104592 has been marked as a duplicate of this bug. ***
Comment 24•23 years ago
|
||
addition to the comment #21 :- 1. with no COLS defined - the text within the textarea never wraps. the horizontal bar is displayed 2. with COLS defined - the text within the textarea wraps always. No horizontal bar displayed. This happens with all the following:- <textare wrap="hard"> <textare wrap="soft"> <textare wrap="off"> <textare wrap="virtual">
Comment 25•23 years ago
|
||
Comment 26•23 years ago
|
||
*** Bug 101729 has been marked as a duplicate of this bug. ***
Comment 27•23 years ago
|
||
*** Bug 92851 has been marked as a duplicate of this bug. ***
Comment 29•23 years ago
|
||
McCluskey: If this change was made because the next beta is in its final stages, please renominate this bug after the beta goes through (to save me the trouble from doing it). This is something that *NEEDS* to be in Netscape--it's a fundamental aspect of form behavior and we've done it the wrong way for too long.
Comment 30•23 years ago
|
||
Meh to that. Renominating. If you still think this isn't important enough for the next Netscape release, I'd like to hear some good reasons why. This behavior is mandated in the current HTML recommendation, and creates a hassle for users. Furthermore the previous rejection was made by a user who has no prior involvement with this bug.
Comment 31•23 years ago
|
||
I agree, this bug sucks ass for me when using Bugzilla. I enter a comment, go to check something, come back, and my comment has hard returns in it. Kevin McCluskey is my manager, so he's involved behind the scenes watching these bugs :) I plan to re-look at the milestone on this when I've gone through my other bugs in a few days, we shall see. On another note, I didn't remember that form state memory was even *in* the specification, but I know for certain that it's not mandated (I checked when I was doing my first form patch). If you're interested in pursuing this patch, just email me, I can give pointers.
Comment 32•23 years ago
|
||
> This behavior is mandated in the current HTML recommendation
The hell it is. the "wrap" attribute is not mentioned anywhere in the HTML
specification and CSS explicitly says that it does not apply to form controls.
This bug is a major annoyance but a spec-compliance issue it is not.
Comment 33•23 years ago
|
||
Bulk moving all nsbeta1 nominations to Moz1.1. If the nomination is approved it will be marked nsbeta1+ and moved to the Mozilla1.0 milestone.
Target Milestone: Future → mozilla1.1
Comment 34•23 years ago
|
||
Marking nsbeta1-. If we have time jkeiser will try and work on it for Mozilla1.0, but at this point engineers are overloaded with higher priority bugs.
Comment 35•23 years ago
|
||
This patch doesn't recognize soft/hard/virtual/physical settings, but does get the wrap=off case working. Bug 41464 is another animal entirely, and the ultimate solution probably solves both simultaneously.
Comment 36•23 years ago
|
||
Bill, could you please use 'diff -u' (or 'cvs diff -u') to create a unified diff of this patch? Those are much much easier to review...
Comment 37•23 years ago
|
||
Done.
Updated•23 years ago
|
Whiteboard: [CSS1-5.6.2]
I think we do support wrap=hard, which means, as I understand it, that the wrapping that occurs while the user types in the textarea should be sent to the server as linebreaks, as opposed to the default behavior, where only user-entered linebreaks should be sent to the server. I think bugzilla actually relies on this working, and why bugzilla comments entered with some other browsers show up as one long line. wrap=soft is the default, and we clearly support that. I'm not sure what wrap=virtual or wrap=physical are -- they're not described in any of: http://www.w3.org/TR/html40/interact/forms.html#h-17.7 http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340 http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/wrap.asp Making wrap be reflected in the DOM should be a separate bug. It looks like that patch uses tabs instead of spaces -- please stick to spaces.
Also, since you're using it as a boolean, |PRInt32 taFlag| should probably have type PRBool and be assigned values PR_TRUE or PR_FALSE. It seems better to call it something like |isTextarea| (if that's what it means).
Comment 40•22 years ago
|
||
The wrap = virtual and wrap = physical attributes are used by Netscape 4. If wrap is not specified or set to off, Netscape 4 leaves long lines as is. This has the unfortunate effect of creating horizontal scrollbars. Because of this, almost every page written for Netscape 4 uses wrap=virtual. Wrap=virtual says that long lines should be displayed with line breaks but transmitted without (except for user inserted breaks - equivalent to wrap=soft?) and wrap=physical says that long lines should be displayed and sent with line breaks included (wrap=hard?).
Comment 41•22 years ago
|
||
> wrap=physical says that long lines should be displayed and sent with line > breaks included (wrap=hard?). One would think.... :) See bug 77110, however. IE, NS4/Windows, and NS4/Unix, at least, treat wrap=physical the same as wrap=virtual, the same as wrap=soft.
Comment 42•22 years ago
|
||
Following David Baron's suggestions in Comment 38 and 39, redeclared the flag variable, eliminated tabs, and removed uneccessary whitespace changes.
Comment 43•22 years ago
|
||
*** Bug 135100 has been marked as a duplicate of this bug. ***
Comment 44•22 years ago
|
||
also seeing soft wrap with wrap="off" in windows 2000
Comment 45•22 years ago
|
||
Holy purple garbonzos man, what browser were you using (and what version if us)? You removed the entire CC list.
Comment 46•22 years ago
|
||
*** Bug 148956 has been marked as a duplicate of this bug. ***
Comment 47•22 years ago
|
||
Comment on attachment 74514 [details] [diff] [review] Cleaned up patch to get wrap=off working. Please check type == NS_FORM_TEXTAREA rather than adding the isTextarea bool. Need short comment explaining what it is doing--that it is ignoring cols when wrap=soft. NS_CONTENT_ATTR_NOT_THERE != rv ... switch to rv != NS_CONTENT_ATTR_NOT_THERE Also, what happens when you set wrap via JS? Does it work? Did it work before?
Comment 48•22 years ago
|
||
Isn't that patch depending on a bug? (bug 119915 to be exact).
Comment 49•22 years ago
|
||
Added a simple test case with javascript wrapping control.
Comment 50•22 years ago
|
||
This incorporates jkeiser's suggested changes. Changing the wrap attribute with DOM is unsuccessful, as it is before the patch.
Attachment #71296 -
Attachment is obsolete: true
Attachment #71425 -
Attachment is obsolete: true
Attachment #74514 -
Attachment is obsolete: true
Comment 51•22 years ago
|
||
Each textarea has a different initial setting of the wrap attribute and a means to change it with javascript. There is no difference between soft, hard, and undefined with or without the patch. Off is like the others without the patch but does not wrap with the patch. Changing any of them with javascript does nothing at all (both without and with the patch).
Comment 52•22 years ago
|
||
Each textarea has a different initial setting of the wrap attribute and a means to change it with javascript. There is no difference between soft, hard, and undefined with or without the patch. Off is like the others without the patch but does not wrap with the patch. Changing any of them with javascript does nothing at all (both without and with the patch).
Comment 53•22 years ago
|
||
Comment on attachment 93041 [details]
Test case showing all relevant possibilities
Sorry about that. I double-submitted.
Attachment #93041 -
Attachment is obsolete: true
Attachment #93041 -
Attachment is patch: false
Attachment #93041 -
Attachment mime type: text/plain → text/html
Comment 54•22 years ago
|
||
They renamed that file out from under my patch. This is the same patch, but for the new file name.
Attachment #93040 -
Attachment is obsolete: true
Comment 55•22 years ago
|
||
Comment on attachment 93054 [details] [diff] [review] Same patch, new file name r=jkeiser
Attachment #93054 -
Flags: review+
Assignee | ||
Comment 56•22 years ago
|
||
Comment on attachment 93054 [details] [diff] [review] Same patch, new file name This patch still doesn't address: 1. The problem with the CSS white-space property mentioned in the summary. 2. The fact that the wrap value can be changed realtime. That all said, and the fact that I know the method we use to force wrapping in the text widgets need to be reworked, I'm going to sr=kin@netscape.com this change because I know it covers the "set it and forget it" case which is most commonly used, and I'm not going to have the cycles any time soon to address this properly. After checkin, leave this bug open, or file 2 separate bugs about the 2 issues mentioned above.
Attachment #93054 -
Flags: superreview+
Comment 57•22 years ago
|
||
i've sent an email to drivers@mozilla.org. hopefully this can go in ASAP before mozilla 1.1 final is out.
Comment 58•22 years ago
|
||
Comment on attachment 93054 [details] [diff] [review] Same patch, new file name a=asa (on behalf of drivers) for checkin to 1.1
Attachment #93054 -
Flags: approval+
Comment 59•22 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 60•22 years ago
|
||
i've split the rest of this bug into two different bugs : bug# 159981 - white-space:nowrap or white-space:pre dont work bug# 159979 - textarea wrapping controls dont work with javascript all of my problems have been solved with the patch included in this bug report so if anyone here wishes to pursue it further, use the two bugs referenced above. i wont be active in getting either of those resolved -- they dont concern me significantly. thanks.
Comment 61•22 years ago
|
||
All right, everyone who tested this patch made a SERIOUS error. Now the behavior is reversed: If rows/cols info is provided, it works correctly, if not, textareas are NEVER wrapped. Attaching a complete testcase.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 62•22 years ago
|
||
Assignee | ||
Comment 63•22 years ago
|
||
Skewer, you are talking about bug 119915 which bz mentioned above. It's been a bug for a long time, even prior to the checkin of attachment 93054 [details] [diff] [review].
Status: REOPENED → RESOLVED
Closed: 22 years ago → 22 years ago
Resolution: --- → FIXED
Comment 64•22 years ago
|
||
I don't understand how that became a seperate issue from this bug, but if nothing has regressed, there's no problem.
Updated•22 years ago
|
QA Contact: vladimire → tpreston
Comment 65•22 years ago
|
||
why is this marked 'RESOLVED FIXED'? this is NOT fixed in 1.0.1, or am i missing something?
Comment 66•22 years ago
|
||
this bug, combined with bug 80341, make Mozilla and K-Meleon WORTHLESS for developers who edit code templates via html forms.
Comment 67•22 years ago
|
||
rob johnson : please download 1.1 and try it out. This bug is fixed in 1.1 final and is therefore marked resolved - fixed. if you want to bitch/whine about how it was fixed go to bug# 159981 - white-space:nowrap or white-space:pre dont work bug# 159979 - textarea wrapping controls dont work with javascript and submit patches or whatever.
Comment 68•22 years ago
|
||
Rob: 1.0.1 is based on 1.0, which branched from the trunk in _April_. In other words it's ancient code that is maintained for embeddors who really want stability. The only fixes going into that branch are critical security fixes.
Comment 69•22 years ago
|
||
my bad, the mozilla.org news announces "Mozilla 1.0.1 Release" so i mistakenly thought this was the most recent release. sorry.
Comment 70•19 years ago
|
||
This bug (tested with white-space:nowrap) seems to be present in Firefox 1.0.7. Please fix.
Comment 71•19 years ago
|
||
That's bug 82711, not this bug. And if you want it fixed, chances are you'll have to do it yourself or pay someone to do it.
You need to log in
before you can comment on or make changes to this bug.
Description
•