contenteditable overwrite deletes too many nodes
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox99 | --- | affected |
People
(Reporter: scalesjordan, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome)
Steps to reproduce:
-
Paste the following into your address bar
data:text/html;charset=utf-8,<main contenteditable><div><div>foo</div></div><div><div>bar</div></div></main>
-
Select from the beginning of the first line to the end of the second line
-
Verify the selection begins and ends at text nodes
-
Enter a character “x” to “overwrite” the selection
Actual results:
See that the nested divs are gone entirely
<main contenteditable="">q</main>
Expected results:
See that the remaining text “x” is contained within two nested divs
<main contenteditable=""><div><div>q</div></div></main>
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Selection' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Confirmed with Ubuntu 20.04.
Chrome's behavior is the one expected by the reporter.
The selection (document.getSelection()
) is as expected. If this is indeed considered a bug, it's in editor. I wrote "if", because editor behavior isn't specified, but the reporter's expectation seems reasonable.
Comment 3•2 years ago
|
||
Yeah, our editor deletes parent block elements too when it becomes empty...
Description
•