Bug 275185
| Summary: | Selection's .focusOffset can exceed the number of child nodes that .focusNode has | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Han <laughinghan> |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ahmad.saleem792, karlcow, megan_gardner, rniwa, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 14 | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=251020 | ||
Han
In both Safari 17 and the latest Safari Tech Preview, the selection's .focusOffset can exceed the number of child nodes that .focusNode has, if the cursor is at the top-level of a contentEditable and a child is removed in a `beforeinput` event handler: https://output.jsbin.com/wupuhef
Possibly related? https://bugs.webkit.org/show_bug.cgi?id=251020
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
*** Firefox Nightly 128 ***
focusOffset: 7 focusNode children: 7
focusOffset: 6 focusNode children: 6
focusOffset: 7 focusNode text length: 7
focusOffset: 6 focusNode text length: 6
*** Safari Technology Preview 196 ***
focusOffset: 7 focusNode children: 7
focusOffset: 7 focusNode children: 6 <---- focusOffset
focusOffset: 7 focusNode text length: 7
focusOffset: 6 focusNode text length: 6
*** Chrome Canary 127 ***
focusOffset: 1 focusNode children: 0
focusOffset: 6 focusNode children: 6
focusOffset: 7 focusNode text length: 7
focusOffset: 6 focusNode text length: 6
Radar WebKit Bug Importer
<rdar://problem/129715470>