[contenteditable] Custom or inline element duplicated when deleting selection that spans different block element types

NEW
Unassigned

Status

()

Core
Editor
P3
normal
a year ago
a year ago

People

(Reporter: javan, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
Created attachment 8829246 [details]
ff-element-duplicated.gif

Steps to Reproduce:

1. Paste the following Data URI into your address bar:

   data:text/html;charset=utf-8,<x-foo contenteditable><div>ab</div><p>cd</p></x-foo>

2. Place the cursor before "b" and select through "c" so that both letters are selected

3. Press backspace


Expected Results:

<x-foo contenteditable>
  <div>ad</div>
</x-foo>

Actual Results:

<x-foo contenteditable>
  <div>a</div>
</x-foo>
<x-foo contenteditable>
  <p>d</p>
</x-foo>

Additional details:

Enabling dom.webcomponents.customelements.enabled and registering the element with document.registerElement has no affect.

The same problem is reproducible using <span contenteditable> as the containing element (instead of <x-foo contenteditable>) so I suspect Firefox treats the contained elements as invalid block children of an inline parent. Styling the container with "display:block;" doesn't help, and in either case the contenteditable element should not be duplicated.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Blocks: 1332973
You need to log in before you can comment on or make changes to this bug.