Created attachment 464295 [details] test-case When WebKit "adjusts" the requested selection to an "equivalent" position, it does not seem to take CSS "content" text info account.
Specifically, try the attached test-case. Note that the selection.collapse requests the caret before *after* the arrow character, but after "selection fixup" the caret is *before* the caret. This is a WebKit-specific bug. It seems to be the way WebKit adjusts the selection (contrary to the html5 specification) is a classical case of "technical dept" - a complicated fragile work-around for some other problem. Any plans to fix this?
Bug confirmed on Safari 16.2.
<rdar://problem/104042048>
Just to update: Safari 16.3, WebKit ToT - both show ‘caret’ before arrow character. It is same in Chrome Canary 111. In case of Firefox Nightly 111, it shows caret after arrow character.