Closed Bug 84416 Opened 25 years ago Closed 25 years ago

Paste into <textarea> outside of content produces unexpected results.

Categories

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

x86
Linux
defect

Tracking

()

VERIFIED DUPLICATE of bug 57913
mozilla0.9.3

People

(Reporter: mrsam, Assigned: anthonyd)

Details

(Whiteboard: [textarea][paste])

Here's a crude drawing of a <textarea> widget in a mozilla browser window, X11/Gnome, Linux. Below, 'xxxx' represents the existing content of this textarea widget: a couple of lines of text, each line is terminated by a newline: *----------------------------------------* | | | xxxxx | | xxxxx + | | xxxxx | | xxxxx | | | *----------------------------------------* Let's say I have "lllllll" in the X paste buffer. I move the pointer to the spot represented by "+" above, and press the middle mouse button to paste the text. I would expect "llllll" to be appended to the end of the 2nd line of "x"s. Instead, "llllll" gets prepended to the beginning of the 3rd line. Instead of: xxxxx xxxxxlllllll xxxxx xxxxx I end up with: xxxxx xxxxx lllllllxxxxx xxxxx It looks like the pasted content is logically inserted after the newline that ends the second line of text, instead of just before it. The results are rather unexpected. I'm trying to clearly paste some content at the end of the line, but I instead wind up pasting it at the beginning of another line.
Excellent explanation! -> Editor.
Assignee: trudelle → beppe
Status: UNCONFIRMED → NEW
Component: XP Toolkit/Widgets → Editor
Ever confirmed: true
QA Contact: aegis → sujay
I wish all of our bug reports were like this! Handing this over to jfrancis and cc kin Is there anyway we could snap to the left of the br? instead of to the right?
Assignee: beppe → jfrancis
Priority: -- → P3
Target Milestone: --- → mozilla0.9.3
I don't think this is a rules bug, so it shouldn't be on jfrancis' plate. I think the editor middlemouse paste event code needs to use the same point to content/offset lookup that Selection uses. I believe right now it is calling some utility method on nsIDOMNSEvent to get the content and offset of where it should paste.
This should go to anthonyd ... he has a bug #57913, which sounds similar to this, already on his 0.9.2 plate. I'll let anthonyd decide if it's a dup or not.
Assignee: jfrancis → anthonyd
DUPE! of 57913. the only problem this is, is once again we get the grey area of "whats expected". personally, if i paste after a linefeed, i expect it ot appear on the nextline, but some would argue that should not be possible, eh. anyway, this is definietly "middlemouse paste is wonky dupe" *** This bug has been marked as a duplicate of 57913 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Whiteboard: [textarea][paste]
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.