Closed
Bug 57913
Opened 24 years ago
Closed 23 years ago
middle-click pasting into unoccupied area of textarea often misplaces pasted text
Categories
(Core :: Layout: Form Controls, defect, P1)
Tracking
()
VERIFIED
FIXED
mozilla0.9.4
People
(Reporter: anthony, Assigned: dbaron)
References
Details
(Keywords: regression, Whiteboard: [selection][textarea] critical for 0.9.4)
Attachments
(4 files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
If you try to use normal X windows pasting (with the middle mouse button)
to cut and paste some words in a textarea, and you try to paste it into
a blank line, it will instead paste it into the same horizontal position,
but in the line above or below (depending on which one you were slightly
closer to when you clicked.)
This is counter to NS4 behaviour, and almost every other X application
I've ever seen. I'd expect it to paste it at the start of the
blank line (as NS4 and all the other X apps I can think to try, do).
The only way to get it to paste onto the blank line is to click on the
far far left _precisely_ at the right point. This is somewhat tricky.
I'll attach a test case that makes it easy to play with.
Reporter | ||
Comment 1•24 years ago
|
||
Updated•24 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 3•24 years ago
|
||
I'm seeing this behavior on Linux with a current CVS build; confirming this
bug.
What is going on is wierd, in my experiments. This bug only seems to happen
in the case where the mouse cursor is further to the right than the end of the
text both above and below the blank line. If the mouse is to the left of a
line endpoint, it will paste into the blank line relatively fine.
If there is a multi-line blank space, only the first line of the multiline
space is affected; other lines are 'normal' and can easily be pasted into.
Comment 5•24 years ago
|
||
reassign to jfrancis; I think he already has a bug on something like this (and
maybe a fix already too!)
Assignee: beppe → jfrancis
Target Milestone: --- → mozilla0.9
Assignee | ||
Comment 6•24 years ago
|
||
Things like this make textareas very difficult to use and have been driving me
crazy since around the NOXIF landing, I think. Nominating for dogfood,
mozilla0.9, nsbeta1.
Comment 7•24 years ago
|
||
This is a selection issue. Handing off to current selection czarina Anthony
Davis.
Assignee: jfrancis → anthonyd
accepting bug...i REALLY need to get redhat 7.0 so i can fix my linux box...
anthonyd
Status: NEW → ASSIGNED
Comment 10•24 years ago
|
||
moving to mozilla 0.9.1
anthonyd
Target Milestone: mozilla0.9 → mozilla0.9.1
Comment 11•24 years ago
|
||
Erm, I'm seeing this with further randomness.
If I'm doing quite a long bugzilla comment, and I review the text at the top of
the textarea by scrolling up, and have the cursor go down line by line as I
read, then get to the bottom, and paste some text from another app, _very_ often
it will be pasted in the middle of some text from the top of the textarea.
This has p*ssed me off so much that some comments I have had to abort.
Several people in #mozilla have seen this too, quite a discussion happening
right now in there.
Updated•24 years ago
|
Whiteboard: [select]
Updated•24 years ago
|
Keywords: mozilla0.9,
nsbeta1
Updated•23 years ago
|
Whiteboard: [select] → [select][textarea]
Comment 13•23 years ago
|
||
ok, got with jag (jaggernaut@netscape.com) and he got middle mouse paste working
on windows. I will continue my work on this bug.
anthonyd
Comment 14•23 years ago
|
||
middlemouse stuff is checked in. moving this 0.9.3.
anthonyd
Whiteboard: [select][textarea] → [selection][textarea]
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Comment 15•23 years ago
|
||
*** Bug 84416 has been marked as a duplicate of this bug. ***
Comment 16•23 years ago
|
||
middle mouse functions are quite common
reviewed and approved
Keywords: nsBranch
Comment 17•23 years ago
|
||
moving out to 1.0
Keywords: nsBranch
Target Milestone: mozilla0.9.3 → mozilla1.0
Comment 18•23 years ago
|
||
See also bug 48786, Middle click pasting in textfield inserts at wrong point
within field.
Reporter | ||
Comment 19•23 years ago
|
||
Actually, this and bug 48786 are pretty much duplicates, as far as I can see.
They're assigned to different people, and this one seems to have more meaningful
keywords &c. Not sure on the bugzilla ettiquette w.r.t. marking one or the other
as a dupe. (I just want it fixed :)
Comment 20•23 years ago
|
||
gee, I should have seen that they were dupes! -- so I will dupe kin's to yours.
Comment 21•23 years ago
|
||
*** Bug 48786 has been marked as a duplicate of this bug. ***
Comment 22•23 years ago
|
||
Hacky workaround (probably obvious but I'll post it anyway):
Create and save text.html:
<html>
<head>
</head>
<body>
<textarea cols=150 rows=30>
</textarea>
</body>
Load text.html in a new mozilla window. Paste with middle button. Select all,
CTRL+X. Switch to other window. Paste with CTRL+V.
This works because you are always middle-button-pasting into an empty textarea,
hence pasting cannot be misplaced.
Comment 23•23 years ago
|
||
Summary should be changed to something like: "textarea middle-button pasting
into unoccupied area is wonky"
"Unoccupied area" means an area that doesn't have any text in, not even spaces,
e.g.:
In this diagram . represents spaces:
.............foo
^ Occuppied ^Unoccupied
Comment 24•23 years ago
|
||
*** Bug 84217 has been marked as a duplicate of this bug. ***
Updated•23 years ago
|
Summary: textarea pasting into the middle of blank lines is wonky. → middle-click pasting into unoccupied area of textarea often misplaces pasted text
Comment 25•23 years ago
|
||
*** Bug 91991 has been marked as a duplicate of this bug. ***
Comment 26•23 years ago
|
||
*** Bug 93616 has been marked as a duplicate of this bug. ***
Comment 27•23 years ago
|
||
If it helps, I'm having some success with this workaround under Linux (using
moz0.9.3):
As long as the insert point has at least some text to the right (could be a
space " "), middle-click insertion seems to work.
If I try to insert at the end of a line (common) or the beginning of a new line
(also very common), all sorts of wonky stuff happens.
Comment 28•23 years ago
|
||
*** Bug 94525 has been marked as a duplicate of this bug. ***
Comment 30•23 years ago
|
||
Hehe. I was bitten by this (again) just by trying to paste past EOL. Unless
you HIT the spaces, it'll still jump around. Not much of a workaround since you
have to have god-like aim in order to paste successfully much.
Reporter | ||
Comment 31•23 years ago
|
||
The only reliable way to do pasting in a textarea is to use
the keyboard shortcut (^V for me).
Middle click is just too damn hairy.
Comment 32•23 years ago
|
||
I have noticed something...
If you hit ^V then it gets pasted whatever you selected with the keyboard
before... So if you use the keyboard to paste something you copied with the
mouse, it will NOT print anything, or it will print something you dont want to...
So, 2 clipboards? One for the keyboard and one for the mouse? That's what it is
happening.
I think a target milestone of 1.0 is too high. Can't we try a 0.9.5?
Comment 33•23 years ago
|
||
*** Bug 92622 has been marked as a duplicate of this bug. ***
Comment 34•23 years ago
|
||
moving 0.9.4
to get this in.
anthonyd
Target Milestone: mozilla1.0 → mozilla0.9.4
Comment 35•23 years ago
|
||
Hmm I just had an unfriendly experience of this myself. In a bugzilla comment, I
typed a few words, hit return, opened a quote, then right-clicked hovering over
the opened quote to past in the text I wanted from further down the page.
Instead of filling the quotation, it jumped up one line, moved across to the far
right edge of the text, then pasted. I hit ctrl+z and undid it, then looked in
the edit menu, and non of the "Cut", "Copy" or "Paste" items were enabled. The
cursor remained in the correct place throughout, clearly the paste procedure
doesn't care where the cursor happens to be...
I had to go back down, repeat the selection, use Edit>Copy, then move the cursor
in to the open quotation, and hit ctrl+v to paste in the right place. How very
frustrating and time consuming.
Comment 36•23 years ago
|
||
This is a serious regression.
Keywords: regression
Whiteboard: [selection][textarea] → [selection][textarea] critical for 0.9.4
Comment 37•23 years ago
|
||
*** Bug 95877 has been marked as a duplicate of this bug. ***
Comment 38•23 years ago
|
||
*** Bug 96292 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 39•23 years ago
|
||
I think the problem here is that nsBlockFrame needs to override
GetContentAndOffsetsFromPoint so that it searches the lines vertically first,
then horizontally.
Assignee | ||
Comment 40•23 years ago
|
||
I suspect what made this worse recently was mjudge's change in revision 3.315 of
nsFrame.cpp. (In particular, the commenting out of two lines that made the Y
distance a more important criterion.) However, I think the correct fix is
probably still to override the method in nsBlockFrame.
Assignee | ||
Comment 41•23 years ago
|
||
Assignee | ||
Comment 42•23 years ago
|
||
Assignee | ||
Comment 43•23 years ago
|
||
My second patch was an attempt also to fix the problems of pasting below what
has already been typed into the textarea. It didn't work because I ran into
problems relating to anonymous content (see comments in nsFrame.cpp in the
patch), and I couldn't understand what the current code at the end of
GetContentAndOffsetFromPoint was doing.
So does the first patch look good? Or does anyone have any ideas how to improve
the second?
Assignee | ||
Comment 44•23 years ago
|
||
I'm going to attach a proposed minimal patch for review. kin suggested on IRC
this morning that I might want to uncomment the anonymous content check --
however, that seems to make things a little worse. When I uncomment it, pasting
in the area below what is typed doesn't move the caret at all. Actually, with
the patch I'm about to attach, pasting in the area below what is typed seems to
work as expected.
Assignee | ||
Comment 45•23 years ago
|
||
Comment 46•23 years ago
|
||
The patch looks good. Commenting out that Y check was a big mistake, I wish he
had talked to me before checking that in! Thanks for catching that!
The patch also seems to fix some selection auto-scrolling problems I noticed
recently, and also fixes bug 57913.
sr=kin@netscape.com
On another front, I'll need to investigate the problem you mentioned when
turning on the anonymous content code in that same routine. That code is needed
to prevent cases where selection spans both content in the tree and anonymous
content, which can cause crashes like bug 92481. mjudge said he didn't know why
he turned it off.
Assignee | ||
Comment 47•23 years ago
|
||
OK, taking so that I can get this in for 0.9.4.
Assignee: anthonyd → dbaron
Severity: normal → major
Status: ASSIGNED → NEW
Priority: P3 → P1
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 48•23 years ago
|
||
r=bryner
Assignee | ||
Comment 49•23 years ago
|
||
Got a=chofmann by email.
Fix checked in 2001-08-26 11:33:57 PDT. Marking as FIXED.
Are there any other bugs that need to be split off of this?
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 50•23 years ago
|
||
If what you mean is that you ask for closely related bugs, see bug 97053
that I have just filed: quadruple click should select all the form.
If this is not what you mean, sorry for the spam.
Comment 51•23 years ago
|
||
Yeah, baby, yeah! :-)
Gerv
Reporter | ||
Comment 52•23 years ago
|
||
linux 2001-08-26-22: Works for me. Can't reproduce any of the bad
things from before.
thankyouthankyouthankyouthankyou.
Assignee | ||
Comment 53•23 years ago
|
||
FWIW, last night I actually did reproduce one of the bad things I'd seen in the
past, and if I see it again and figure out any idea of how to reproduce it, I'll
file a bug. What I was seeing was that after pasting about ten snippets of
multiline text at the end of a textarea, finally, by the last one, it decided to
put the text at some random spot in the middle of a line in the middle of the
textarea. I don't know if it was a content targetting problem, an editor
problem, or what...
Reporter | ||
Comment 54•23 years ago
|
||
Hm. I've seen that behaviour in the past, but I've not been able to reproduce it
by the traditional 'clicking like a crazed ferret' method. From memory, it was
more likely
to occur if the text insert cursor was somewhere other than where you were pasting.
The only problem I'm seeing now is that for some reason my text areas have
started coming up in a proportional font - hunting for a bug# for that now :)
Comment 55•23 years ago
|
||
I wonder if what dbaron is seeing is related to bug 74383. While debugging
74383, I was seeing wierd placement and characters after several pastes, which
was the result of stale frame data used during reflow.
Comment 56•23 years ago
|
||
I've seen the paste-somewhere-else behavior Dbaron reports, too. I've noticed
it most in the Mail composition window. It's much harder to reproduce consistently.
Perhaps this should be reported as a new bug, since it's probably unrelated to
the current one. (But if you do, please post the bug number here.)
Comment 57•23 years ago
|
||
I have posted bug 97207 on a similar paste position problem.
*** Bug 80476 has been marked as a duplicate of this bug. ***
Comment 60•23 years ago
|
||
*** Bug 102211 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•