Bug 250009 - css content ignored when adjusting selection
Summary: css content ignored when adjusting selection
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 16
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-02 12:50 PST by Per Bothner
Modified: 2023-01-24 16:54 PST (History)
4 users (show)

See Also:


Attachments
test-case (312 bytes, text/html)
2023-01-02 12:50 PST, Per Bothner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.