Last Comment Bug 310201 - D&D: dropped text is double-spaced
: D&D: dropped text is double-spaced
Status: RESOLVED FIXED
: fixed1.8
Product: Core Graveyard
Classification: Graveyard
Component: Widget: OS/2 (show other bugs)
: Trunk
: x86 OS/2
: -- normal (vote)
: ---
Assigned To: Mike Kaply [:mkaply]
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-27 11:20 PDT by Rich Walsh
Modified: 2014-12-09 11:27 PST (History)
1 user (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
remove CRs from dropped text (2.46 KB, patch)
2005-09-27 11:23 PDT, Rich Walsh
mozilla: review+
mtschrep: approval1.8rc2+
Details | Diff | Splinter Review

Description Rich Walsh 2005-09-27 11:20:56 PDT
While responding to Bug #267609, I dragged some text from a file & dropped
it into the Comments text area.  Although it was correctly formatted when
I dropped it, it was double-spaced after I committed the comment.

My guess is that the CrLf is being interpreted as two separate linebreaks.
This patch should fix the problem by eliminating all carriage returns from
dropped text.  The text you're reading will confirm whether my guess is
correct because it was composed with explicit CrLf linebreaks and was
dropped into the Comments text area.
Comment 1 Rich Walsh 2005-09-27 11:23:27 PDT
Created attachment 197593 [details] [diff] [review]
remove CRs from dropped text

looks like it works...
Comment 2 Mike Kaply [:mkaply] 2005-09-27 11:37:13 PDT
Comment on attachment 197593 [details] [diff] [review]
remove CRs from dropped text

Seems like a lot of work to remove carriage returns... :)
Comment 3 Rich Walsh 2005-09-27 13:17:27 PDT
(In reply to comment #2)
> Seems like a lot of work to remove carriage returns... :)

I can't say that I understand this comment.  Allocating a new buffer for the
results would require more work, as would examining the text character by character.
Comment 4 Mike Kaply [:mkaply] 2005-09-27 13:52:47 PDT
(In reply to comment #3)
> I can't say that I understand this comment.  Allocating a new buffer for the
> results would require more work, as would examining the text character by
character.

True. If only it was an nsString....

Anyway, I'll check this in asap.
Comment 5 Peter Weilbacher 2005-09-27 14:19:21 PDT
From your description it could just as well be a bug in Bugzilla but I just
confirmed the problem with a webmail site. Still, I wonder if there there is a
standard that says that text in HTML forms should only be LF and not CRLF? I
didn't find it but I could just have used stupid search parameters...

The problems is also present on the 1.8 branch.
Comment 6 Peter Weilbacher 2005-10-31 09:51:12 PST
I found RFC 1867 which says in section 5.9 that CRLFs are to be used as line separators in HTML forms. But forms get converted to CRLF anyway on submission (somewhere in nsFormSubmission.cpp) so that this is indeed the correct fix.
Comment 7 Mike Kaply [:mkaply] 2005-11-04 07:14:39 PST
Comment on attachment 197593 [details] [diff] [review]
remove CRs from dropped text

OS/2 only fix
Comment 8 Mike Schroepfer 2005-11-04 12:03:48 PST
Comment on attachment 197593 [details] [diff] [review]
remove CRs from dropped text

OS/2 Only - approved to land

Note You need to log in before you can comment on or make changes to this bug.