**Contact emails**
r...@igalia.com, dazab...@igalia.com

**Specification**
https://www.w3.org/TR/css-pseudo-4/#selectordef-selection

**Summary**

Right now selection background color is inverted when it matches the
text color in Chromium.
So if you have a rule like this "::selection { color: cyan; background:
cyan; }" the background gets inverted and a red background color is used.
This is an old behavior inherited from WebKit but Safari doesn't do this
anymore (and Firefox has never done this).
The proposal is to stop inverting the background color for ::selection.

**Blink component**
Blink>CSS

**TAG review**
N/A

This is mostly a bug fix but we're sending the intent as a PSA and due
to the potential compat risk.

**Risks**

**Interoperability and Compatibility**

The current Chromium behavior comes from WebKit
(trac.webkit.org/changeset/52548/webkit).
WebKit has changed this behavior in the past and is no longer doing this.
Firefox has never done this.
This will align Chromium with the other browsers.

Use counter was added in M93 and it's around 0.0003%
(https://chromestatus.com/metrics/feature/timeline/popularity/3934).
This change might make selected content impossible to read in some web
pages (but that's already happening in Safari and Firefox).
Or maybe this is making some webpages work as expected, if they were
using selection colors to hide some content.

Gecko: Shipped/Shipping

WebKit: Shipped/Shipping

Web developers: No signals. This is mostly a bug fix, removing a quirk
to improve interop; so it doesn't look like we need to ask for specific
web developer signals.

**Is this feature fully tested by web-platform-tests?**

We're adding a new test specifically verifying this behavior in
https://chromium-review.googlesource.com/c/chromium/src/+/3199752.

Apart from that css/css-pseudo/active-selection-018.html fails partially
due to this issue if you enable HighlightInheritance runtime flag.

**Tracking bug**
https://bugs.chromium.org/p/chromium/issues/detail?id=1217745

**Link to entry on the Chrome Platform Status**
https://chromestatus.com/feature/5657973985640448

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/d48df17c-160c-4b98-c77c-41f063891570%40igalia.com.

Reply via email to