Open Bug 926164 Opened 6 years ago Updated 3 years ago

Editor deletes blank before inserted block element when converting to text


(Core :: DOM: Editor, defect)

24 Branch
Windows XP
Not set





(Reporter: cacyclewp, Unassigned)


(Keywords: testcase)


(1 file)

1.41 KB, text/html
Attached file Testcase
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130910160258

Steps to reproduce:

1) An edit area contains text with blanks (e.g. a contenteditable div).
2) A block level element is inserted after a blank (either manually or with insertHTML).
3) This block element is selected and converted to text (by setting a range and then using insertHTML). 

Actual results:

Before converting the block to text, the blank is still there for editing. After converting the block element to text, the blank is gone. The blank was, however, NOT part of the manipulated range. This is a serious problem for rich text editors as the text gets corrupted.

Expected results:

The editable text outside the manipulated ranges should be preserved. Chrome does have exactly the same problem.
Component: Untriaged → Editor
Keywords: testcase
Product: Firefox → Core
The blank is conserved as expected when the pasted element is an inline element. It is even conserved when when the inline element is styled as display: block.
This bug is still present in 52.0.1 (!) (Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0) It is still a Major problem as it causes text data corruption!
You need to log in before you can comment on or make changes to this bug.