Pasting text with a trailing space into a contenteditable element leads to unexpected results

NEW
Unassigned

Status

()

Core
DOM: Core & HTML
2 years ago
2 years ago

People

(Reporter: firefoxbugs, Unassigned)

Tracking

({testcase})

43 Branch
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Created attachment 8702084 [details]
bugtest.html

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20151210085006

Steps to reproduce:

Paste "ABC " into a contenteditable <div>.  Then press backspace 3 times.  (Compare that with pasting in only "ABC".)


Actual results:

The space and the 'C' are deleted with the first backspace.  With the third backspace, the cursor jumps above the first line of the <div>.


Expected results:

No idea.  The contenteditable system is completely broken, IMO.  Chrome and Firefox both have completely different implementations, and both are broken with regard to pasting text with a trailing space.  But you'd expect that the trailing space would not be ignored, that two characters would not be deleted with a single backspace, and that the <div> would always maintain at least one line of content, even if it's blank.

Updated

2 years ago
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
Keywords: testcase
Product: Firefox → Core
(Reporter)

Comment 1

2 years ago
NB: To reproduce: When copying the characters, copy from the text above the editable <div> on the attachment.  It treats the formatted and plain text clipboard contents differently.  I cannot reproduce it pasting plain text from a text editor, either with a normal space or with a no-break space (U+00A0).
You need to log in before you can comment on or make changes to this bug.