Bug 273951 - [iOS, iPadOS, visionOS] Add CSS pseudo-element ::selection
Summary: [iOS, iPadOS, visionOS] Add CSS pseudo-element ::selection
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 18
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-05-09 09:25 PDT by Jeffrey Blanz
Modified: 2024-10-23 20:39 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Blanz 2024-05-09 09:25:28 PDT
iOS/iPhones lack the CSS cursor ::selection pseudo-element.

I believe macOS, iPadOS, and possibly visionOS support the events. Considering visionOS seems to be very similar to iPadOS I am assuming visionOS supports it as well.

The ::selection CSS pseudo-element applies rules to the portion of a document that has been highlighted (e.g., selected with the mouse or another pointing device) by the user.
Comment 1 Radar WebKit Bug Importer 2024-05-16 09:26:14 PDT
<rdar://problem/128203999>
Comment 2 Jeffrey Blanz 2024-06-18 11:42:27 PDT
iOS, iPadOS, and visionOS lack support for the CSS ::selection pseudo-element.

Here is a demo: https://quirksmode.org/css/selectors/selection.html
Comment 3 Samuel 2024-10-23 20:39:43 PDT
I have also run into this issue. I suspect there might be some complications due to the fact that iOS shows selection handles on the left and right edges of the selected text, but I'd very much like to be able to style the ::selection pseudo-element in Safari on iOS, including background color, text color, and/or underline style(s), as I can in Safari on macOS.