[csswg-drafts] [css-pseudo] Safari’s ::selection “wash” and UA tweaks to highlight colors (#6853)

delan has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-pseudo] Safari’s ::selection “wash” and UA tweaks to highlight colors ==
Safari has a special approach to painting text ::selection, where it only paints a “wash” on top of the text being selected (see [#6022 irc log](https://github.com/w3c/csswg-drafts/issues/6022#issuecomment-816224154), “blue wash”, “magic transluscent”). The way this is achieved is interesting: iff the author sets the ::selection background to a fully-opaque color, Safari overrides the alpha value to make the color translucent ([demo](https://bucket.daz.cat/work/igalia/0/19.html)).

But @fantasai says:
> UA cannot do these weird things when the author has specified colors. They have to use the author-specified colors with no modification. But when using UA-chosen colors, they can choose anything.

I don’t think we can allow Safari to paint ::selection as a translucent “wash” *and* forbid Safari from making opaque ::selection backgrounds translucent, because any author unaware of Safari’s different approach might set the ::selection background to an opaque color (such as a named color or other color without alpha) while expecting the selected text to stay legible.

I want to agree with @fantasai here and forbid all UA tweaks to author highlight colors (see also #6150). But I think I’m biased here, because I also feel like we should forbid the “text wash”, as both make it easier to specify and test highlight painting precisely.

(@smfr, @mrego)

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6853 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 3 December 2021 13:39:48 UTC