W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2021

Re: [csswg-drafts] [css-pseudo] clarify paired-cascading behavior (#6386)

From: fantasai via GitHub <sysbot+gh@w3.org>
Date: Sat, 24 Jul 2021 21:03:23 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-886111107-1627160602-sysbot+gh@w3.org>
> 1. Does “use” mean used value?

Hmm, I guess this is underdefined. It could even affect the computed value without causing any problems. Probably the answer here should be whatever seems convenient to implementers. 

> 2. Does “highlight colors” refer to a set of properties, and if so, which properties?

It was intended to refer to using the UA's chosen values for selection foreground and background (its “highlight colors”) as color and background-color, matching the set of properties of question 4.

(This should probably say that the UA uses Highlight and HighlightText, actually, now that we have defined these colors as their own keywords.)

> 3. Do we really mean “for ::selection” only, or did we intend this for all highlight pseudos? The note suggests this rule exists for compatibility with existing ::selection impls, but ::target-text often has a default background-color too.

Currently, we do mean ::selection only. It's a very weird behavior, from the perspective of the cascade. If you and @emilio both think it should be extended to ::target-text, we can consider it.

> 4. Do we really mean “neither color nor background-color” only, or any of the applicable properties? 

Yes. Only if 'color' or 'background-color' is set, specifically and intentionally. There was a discussion about how this doesn't match current implementations earlier... we run into problems as new properties are introduced unless we restrict it thus. Suppose, for example, implementation A supports text-shadow on ::selection and implementation B does not. If implementation B cancels its highight colors when it sees the text-shadow declaration, then when an author specifies text-shadow as the only highlight indication, then the highlights will be visible in implementation A and invisible in implementation B.

> 5. What does “specified by the author” mean? My best guess is that “specified by the author” means “cascaded value exists, and its origin was not the user agent”. Not specified as in specified value, which iiuc always exists due to defaulting (to transparent for background-color).

Right, this is the intent. Again, we have this weird cascading behavior because of compat. If you have suggestions on how to simplify without breaking compat, I'd be happy to spec such changes.

> 6. How do we reconcile that with unset and revert? I feel like initial and inherit count as “specified by the author”, because the cascaded and specified values clearly exist for both, but for unset and revert, doesn’t it depend on whether we’re looking “before” or “after” they take effect?

I think if the author wrote
```
p::selection { background: red; }
p::selection { background: revert; }
```

they're looking for the behavior that would have resulted from not writing anything, and it would be good if we can provide that.

> 7. Do all properties become inherited for the purposes of deciding if unset should mean initial or inherit?

I think they would have to, for 'unset' to have the expected effect of erasing any previous declaration.

Thanks for the good questions...


-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6386#issuecomment-886111107 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 24 July 2021 21:03:25 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:39 UTC