-
Notifications
You must be signed in to change notification settings - Fork 719
[css-pseudo] Safari’s ::selection “wash” and UA tweaks to highlight colors #6853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree, but we should also allow |
|
If Safari makes opaque colors specified by the author translucent, then it's going to have different highlight colors than e.g. Blink and Gecko. This can, in fact, result in color/background pairs that while readable in one browser are unreadable in another--and this has occurred on real websites in the past. So either everyone has to apply magic alpha the same way, or there is no magic alpha. We can't have every UA choosing independently on whether to apply alpha magic to author-specified ::selection colors, if we want authors to be able to reliably specify sufficiently-contrasting colors. |
The CSS Working Group just discussed
The full IRC log of that discussion |
Edited. @delan Let me know if the new prose is clear or if it could be written better. |
Thanks @fantasai!
Does this mean setting any |
@delan That was my interpretation of the resolution; though it does seem a bit odd so maybe we need to tweak it. CC @megangardner |
My recollection of the discussion, after reading the transcript, is that if there are any colors then magic doesn't apply. I kinda thought it was odd at the time but I can see why: As soon as there is one color that is author changed the UA can't know what might happen with the other colors and should take what the author said. On the other hand, what if you give a foreground color but not a background color, and the browser only has a unified magic way of setting all default highlight colors? What should the browser do for the background? I suspect that is not a real issue in which case this spec text is fine by me. Otherwise it's probably back to the WG for a resolution saying something about "you must give all colors if you give one", and that seems a stretch. |
Uh oh!
There was an error while loading. Please reload this page.
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, “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).
But @fantasai says:
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”, because both of these would make it easier to specify and test highlight painting precisely.
(@smfr, @mrego)
The text was updated successfully, but these errors were encountered: