Bug 225024
| Summary: | Incorrect selection after spliting text node in range | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Comandeer <vepomoc> |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | ahmad.saleem792, karlcow, megan_gardner, rniwa, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | Safari 14 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Comandeer
Reproduction steps:
1. Open https://jsfiddle.net/Comandeer/ge4qu390/
2. Place the caret at the end of the second line.
3. Press Backspace.
Expected result:
The last character in the second line is deleted.
Actual result:
The selection jumps to the beginning of the paragraph.
If the reproduction steps are repeated with subsequent lines, the selection will jump to the last place of the split.
The splitting logic imitates what happens in CKEditor 4 during pressing Backspace. The error is not reproducible if the custom splitting logic is replaced with the native Text#splitText() method, but due to a bug in Chrome (https://bugs.chromium.org/p/chromium/issues/detail?id=1201161) connected with this method, I was searching for some workaround and discovered this issue.
It works fine in Firefox 88.0.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Comandeer
A similar issue is reproducible in Blink: https://bugs.chromium.org/p/chromium/issues/detail?id=1202439
Radar WebKit Bug Importer
<rdar://problem/77423626>
Ahmad Saleem
I am able to reproduce this bug in Safari 15.5 on macOS 12.4. From the linked Chrome bug link, it was fixed in Chrome 91 and it was already working with Firefox 88.
Ahmad Saleem
It seems to work fine now in WebKit ToT (259906@main). I am changing this to "RESOLVED CONFIGURATION CHANGED".