D&D: dropped text is double-spaced

RESOLVED FIXED

Status

Core Graveyard
Widget: OS/2
RESOLVED FIXED
12 years ago
2 years ago

People

(Reporter: Rich Walsh, Assigned: mkaply)

Tracking

({fixed1.8})

Trunk
x86
OS/2
fixed1.8

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
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.
(Reporter)

Comment 1

12 years ago
Created attachment 197593 [details] [diff] [review]
remove CRs from dropped text

looks like it works...
Attachment #197593 - Flags: review?(mozilla)
(Assignee)

Comment 2

12 years ago
Comment on attachment 197593 [details] [diff] [review]
remove CRs from dropped text

Seems like a lot of work to remove carriage returns... :)
Attachment #197593 - Flags: review?(mozilla) → review+
(Reporter)

Comment 3

12 years ago
(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.
(Assignee)

Comment 4

12 years ago
(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

12 years ago
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

12 years ago
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.
(Assignee)

Comment 7

12 years ago
Comment on attachment 197593 [details] [diff] [review]
remove CRs from dropped text

OS/2 only fix
Attachment #197593 - Flags: approval1.8rc2?

Comment 8

12 years ago
Comment on attachment 197593 [details] [diff] [review]
remove CRs from dropped text

OS/2 Only - approved to land
Attachment #197593 - Flags: approval1.8rc2? → approval1.8rc2+
(Assignee)

Updated

12 years ago
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.