Closed Bug 69024 Opened 24 years ago Closed 23 years ago

Copy text from a textarea drops starting spaces

Categories

(Core :: DOM: Selection, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED DUPLICATE of bug 86450
mozilla1.0

People

(Reporter: BenB, Assigned: anthonyd)

References

Details

(Whiteboard: [plaintext][serializer][copy][correctness])

Attachments

(1 file)

From bug 68166:

Spaces at the beginning of a line are collapsed, e.g.
z
  z
is pasted as
z
z
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.1
this is truly spacey.
related to bug 70549 ?
i need to know what you pasted TO.  It makes a difference.
I see the problem pasting from textareas into xterm or emacs.

Furthermore, highlighting in a textarea and hitting ctrl-c then looking in the X
clipboard, the leading spaces are missing there too.
jfrancis, in this case, it doesn't matter - in all cases, the spaces are lost. I
tried as targets: Same textfield (copy from bugzilla comment field to same
bugzilla comment field), xemacs, gnome terminal. Same result everywhere.
here's the deal: the return gets converted to a <br> at paste time.  Spaces after 
a <br> do not render in html.  So I need to convert the first space after the <
br> to be an nbsp.  My whitespace work in progress will fix this.
my comment above applies to pasting into moz editor widget (any flavor).  Not 
sure yet why pasting into outside tezt-only app would be a problem.  That is 
probably a seperate plaintext-serializer issue.
jfrancis, IMO, copy&paste from a (plaintext) textfield (which this comment field
is) to anything else should copy in plaintext flavor, not HTML. This would lead
to many more-or-less subtle bugs.
it already does.  nonetheless, even plaintext editor widgets have to convert 
newlines into <br> nodes.  The reason for this has to do with implementation of 
layout; it's not something that we just wanted to do for giggles.  :-)
This is happening even when copying from a mozilla textarea and pasting into an
external plaintext app (as Ben noted).  So the plaintext we're generating is
wrong (the leading spaces are already gone), unrelated to anything we do when
pasting it back into our own editor.

This is a regression -- we used to have this problem some six months ago, but it
was fixed.  Does anyone know how long ago this regressed?  That might help in
pinning it down.

Joe, did you say your whitespace changes fix this?  If so, we can just wait for
your landing and not worry about tracking this down further.
*** Bug 72811 has been marked as a duplicate of this bug. ***
Akkana, my ws work does not fix this.  It would, if the space made it that far.  
But they never do.  They are lost at copy time, not at paste time.  Can you find 
an owner for this?  It's almost certainly the plaintext serializer.

You can bounce back to me if you don't care about it getting fixed soon.
Assignee: jfrancis → akkana
Status: ASSIGNED → NEW
Anthony owns the serializers.
Assignee: akkana → anthonyd
moving to 0.9.2
Status: NEW → ASSIGNED
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Whiteboard: [plaintext]
Target Milestone: mozilla0.9.2 → mozilla1.0
admin: nominate for mozilla0.9.3 (no such keyword yet)
I think the title of this bug should be changed because textareas are not the
only place where you can copy text and appears this bug. It also happens when
copying the text from a message composing window.
*** Bug 80835 has been marked as a duplicate of this bug. ***
*** Bug 86208 has been marked as a duplicate of this bug. ***
*** Bug 86373 has been marked as a duplicate of this bug. ***
hmm, sounds like serializer is confused about what flavor to use.
Whiteboard: [plaintext] → [plaintext][serializer][copy][correctness]
I believe this is a dup of 86450 which I have a fix for.

*** This bug has been marked as a duplicate of 86450 ***
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
catching up on verifications
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: