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

> I think right now this is a used-value time operation in Gecko, it's not only theoretical. e.g. the selection background might be inverted based on contrast with the closest non-transparent background color.

Good point, that makes the spec lawyer in me wonder if “UA must use its own […] only when” forbids UA changes to the author’s highlight colors, like Gecko inverting selection backgrounds or Safari on macOS making opaque selection backgrounds translucent ([demo](https://bucket.daz.cat/work/igalia/0/19.html)). Blink (and previously WebKit) [also invert selection backgrounds sometimes](https://crbug.com/1217745), based on foreground similarity (cc @mrego). I believe the spec didn’t intend to forbid these, but I think that’s something worth making more explicit after this issue.

> I think conceptually all, but same concerns about performance apply to this approach (to ::selection as well).

Yeah, performance is definitely something I’m still unsure about. For example, my initial Blink impl won’t make Select All slower, but it will make element style recalc slower, and there could be a big penalty for existing content with universal ::selection rules (looking into mitigations soon). I suppose this issue (except q7) is independent of the inheritance stuff though.

> I guess that may make some sense for highlights as opposed to appearance, but if possible I'd like to keep just one concept for this.

Maybe we should think about which to keep based on how that will affect stylesheets at each origin. I tried to reason about this but didn’t get very far, because I couldn’t figure out how to play with user origin styles in any of the browsers I use.

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


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

Received on Thursday, 9 September 2021 05:19:00 UTC