Open Bug 1081487 Opened 10 years ago Updated 3 years ago

textarea: selected text truncated if it does not end with a newline

Categories

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

32 Branch
x86_64
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: njsg, Unassigned)

Details

I have found an issue when copying text from and to textareas on GNU/Linux (this can't be reproduced on Microsoft Windows, as this is about X selections, which don't exist in Windows):

If the text in a textarea is big enough (I have used https://bpaste.net/raw/dd863d9970a0) and does not end with a newline, if the textarea contents are completely selected using the keyboard (shift + arrow keys), the selected text gets truncated when copied to the PRIMARY selection.

If it is selected from the beginning to the end, it is truncated at the end. If it is selected from the end to the beginning, it is truncated at the beginning.

This can be reproduced by running "xclip -o" in a terminal emulator under the same X Window server, which should just output the contents of the PRIMARY selection. When I select the text from the end to the beginning, I get

> ur adipiscing elit. Integer vel viverra turpis, a lobortis tortor. Fusce nec risus massa. In sed purus consectetur, vulputate ex non, dapibus lacus. Vivamus facilisis maximus faucibus. Cras suscipit porta dolor, vel laoreet elit tempor ut. Donec feugiat nisl et condimentum rutrum. Cras at velit lacinia, placerat nisl commodo, feugiat nisl. Aliquam erat volutpat. Pellentesque dolor enim, sollicitudin quis venenatis sed, vestibulum sit amet nisl. Sed eget posuere nisl.

I have reproduced this behavior in several textareas, including bugzilla's, and MDN's demo textarea:
https://mdn.mozillademos.org/en-US/docs/Web/HTML/Element/textarea$samples/Example

Interestingly, if the text is selected with the mouse, it is completely copied, with no truncation, this only happens when the text is selected using the keyboard.
Component: General → Editor
Product: Firefox → Core

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority and severity.

If you have reason to believe this is wrong, please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.