Bug 225513 - Contenteditable inverts tag nesting
Summary: Contenteditable inverts tag nesting
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-07 08:01 PDT by Victor Borràs
Modified: 2021-05-14 08:02 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Borràs 2021-05-07 08:01:29 PDT
STEPS TO REPRODUCE:
1. Add a <div> with contenteditable.
2. Add the following markup: <a href="#"><mark>link</mark></a>a.
3. In the browser window, type something between "link" and "a".

EXPECTED BEHAVIOR:
The nesting order for the tags is kept, and the new character is added outside of them.

CURRENT BEHAVIOR:
The caracter is added to the mark tag and nesting gets inverted, resulting in this:
<mark><a href="#">link</a>a</mark>a

Reproduction: https://codepen.io/vborrasc/pen/XWMrRpe
Comment 1 Radar WebKit Bug Importer 2021-05-14 08:02:19 PDT
<rdar://problem/78017071>