Bug 250009

Summary: css content ignored when adjusting selection
Product: WebKit Reporter: Per Bothner <per>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
test-case none

Description Per Bothner 2023-01-02 12:50:52 PST
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.
Comment 1 Per Bothner 2023-01-02 12:56:38 PST
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?
Comment 2 Per Bothner 2023-01-02 13:13:34 PST
Bug confirmed on Safari 16.2.
Comment 3 Radar WebKit Bug Importer 2023-01-09 12:51:17 PST
<rdar://problem/104042048>
Comment 4 Ahmad Saleem 2023-01-24 16:54:54 PST
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.