W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2019

Re: [csswg-drafts] [css-pseudo-4] need for clarification on how ::selection text-shadows work (#3932)

From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
Date: Wed, 07 Aug 2019 23:43:57 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-519307845-1565221436-sysbot+gh@w3.org>
The CSS Working Group just discussed `need for clarification on how ::selection text-shadows work`, and agreed to the following:

* `RESOLVED: If multiple layers with text-shadows we draw them all`
* `RESOLVED: Background on a highlight layer paints over shadows on layers below`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: need for clarification on how ::selection text-shadows work<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/3932<br>
&lt;dael> fantasai: I was going over what we want for text-shadows. Came up with a bunch of questions for ::selection text-shadows<br>
&lt;dael> fantasai: Last time we discussed only thought about ::selection but have multiple highlight pseudos that can layer. Models discussed don't make too much sense.<br>
&lt;fantasai> https://github.com/w3c/csswg-drafts/issues/3932#issuecomment-510220043<br>
&lt;dael> fantasai: Summary ^<br>
&lt;dael> fantasai: Default case selection with a background suppresses text-shadows because otherwise might not get enough contrast. Spelling and grammer do not suppress text-shadows. Need to make it that having a highlight there shouldn't suppress text-shadow below<br>
&lt;dael> fantasai: 2 models. Any non-transparent background disables shadows on layers below. Background on any paints over layers below.<br>
&lt;dael> fantasai: Highlight pseudos might want to change order and paint background inbetween<br>
&lt;dael> fantasai: There are questions on multi-layers with text-shadows and they all spec text shadow do we draw top most non-none? All?<br>
&lt;dael> fantasai: I don't have a clear answer to these questions so I want feedback from WG<br>
&lt;dael> AmeliaBR: I don't think have any other way in CSS where you can composit together text-shadow from different declarations<br>
&lt;dael> fantasai: Right, because shadows inherit. Parent inherits to child so shadow takes effect on child unles syou do something. Here is a bunch of layers without parent/child so no clear inheritence. But we don't want something like spelling-error to prevent a shadow<br>
&lt;fantasai> s/shadow/shadow just because it now exists/<br>
&lt;dael> AmeliaBR: As with everything on selection highlight classes I wish we could make sense of this in normal cascade way. I think trying to draw 2 text shadows on same text is strange.<br>
&lt;dael> AmeliaBR: For background layering multiple backgrounds seems to make sense. Question of if it's performant to draw shadows that will be obsurced.<br>
&lt;dael> fantasai: I don't care if we draw background over or don't draw because the background will obscure. Either gets reasonable behavior<br>
&lt;dael> astearns: Main thing is pick easily impl and can be consistent. Seems edge case b/c selection happens on editable text.<br>
&lt;dael> fantasai: COuld select to copy out. THat's frequent<br>
&lt;dael> smfr: Some add funcky text shadow to change anti-aliasing<br>
&lt;dael> astearns: ooh, fun.<br>
&lt;dael> smfr: I'm confused about how thigns are supposed to work. Understand text-shadow style gets cascade into text-shadow on elemnt and paint result. fantasai sounds like saying selection has own text-shadow style hence the layers<br>
&lt;dael> fantasai: Didn't quite follow. In this case you have a word and it is a spelling error and a grammar error and it's selected.<br>
&lt;dael> fantasai: Properties on each pseudo element cascades in and inherited through...trying to remember b/c changed...[reads spec]<br>
&lt;dael> fantasai: You aren't going to have the text-shadow value inherit from base document element. Properties are inherited from parent. Each element has own ::selection and the ::selection of span inherits from ::selection of p which inherits from ::selection of body. Text-shadow around that word text-shadow prop won't have that value on it.<br>
&lt;dael> fantasai: If going to draw text we would see text-shadow:none and that's not okay for spelling error. You don't expect a spelling error to suppress shadows. Even though spelling errors don't have text-shadow you want to draw the shadow<br>
&lt;fantasai> https://drafts.csswg.org/css-pseudo-4/#highlight-cascade<br>
&lt;dael> smfr: It's about the decoration style clobbering the text-shadow of unselected version<br>
&lt;dael> fantasai: Could do it for selection, but not for spelling and grammar. Making it disappear with only difference is underline doesn't make sense and could make text unreadable<br>
&lt;dael> smfr: Impl no problem paining multi shadow. Prefer to avoid complex logic if thigns are transparent<br>
&lt;dael> fantasai: 2 related questions. 1: How do we deal with suppressing shadows when drawing background b/c selection has background. Can do that by saying if bg in non-transparent we don't paint shadows below. Or paint shadows first and then paint background<br>
&lt;dael> smfr: bg may nto be opaque<br>
&lt;dael> fantasai: Right. Or smaller then text-shadow<br>
&lt;dael> fantasai: You could dsitinguish between two, but difference isn't that important question of what's easier to implement<br>
&lt;dael> smfr: Want to look at native platform to see if those make sense and should be matched<br>
&lt;dael> fantasai: Second question is if we have multi-layers spec text-shadow. So author decides spelling error creates a blurred red ext-shadow and grammar is green shadow and selection is orange shadow, do we draw all or only top most non-none?<br>
&lt;dael> smfr: I think draw all. Draw what author asked for<br>
&lt;dael> smfr: Mac native does paint text shadow under selection, I think. You do get combination<br>
&lt;dael> fantasai: Prop: If multiple layers with text-shadows we draw them all<br>
&lt;dael> fantasai: Resolve on that?<br>
&lt;dael> astearns: Objections?<br>
&lt;dael> RESOLVED: If multiple layers with text-shadows we draw them all<br>
&lt;dael> fantasai: Background either suppress or paint over lower level, I think smfr suggests we paint over?<br>
&lt;dael> smfr: Yes<br>
&lt;dael> fantasai: Background on a highlight layer paints over shadows on layers below<br>
&lt;dael> astearns: Obj?<br>
&lt;dael> RESOLVED: Background on a highlight layer paints over shadows on layers below<br>
&lt;dbaron> I'm not crazy about the background painting over thing.<br>
&lt;dael> astearns: Is that enough to spec interop?<br>
&lt;dbaron> seems like the shadows may well peek out at the edges.<br>
&lt;dael> fantasai: THat's enought o spec. Interop depends on impl.<br>
&lt;dael> astearns: There are test cases I expect will need to be ammended to cover<br>
&lt;dael> fantasai: Yeah<br>
&lt;dbaron> (I'm listening, but I'd need to reconnect in order to unmute)<br>
&lt;dael> astearns: dbaron you mentioned you're not crazy about peaking out? I believe that is the case and shadows will show if larger then background<br>
&lt;dael> fantasai: I don't care which way it goes between the 2<br>
&lt;fantasai> as long as we have an answer<br>
&lt;dael> astearns: Let's go with that option. dbaron if you have a change or obj please update the issue<br>
&lt;dbaron> yeah, I don't feel that strongly, but the behavior seems a bit ugly<br>
&lt;fantasai> Also OK if we want to make it a UA choice between the two<br>
&lt;dael> astearns: Anything else on this?<br>
&lt;fantasai> just so long as it's only those two options and not "do anything" :)<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3932#issuecomment-519307845 using your GitHub account
Received on Wednesday, 7 August 2019 23:44:00 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:12 UTC