Chromium currently checks all selection highlight colors against the text color and inverts the highlight color if it matches the text. Hence, author-defined ::selection CSS properties may be modified by the browser despite explicit author intent. For example, a CSS rule "::selection { color: cyan; background: cyan; }" the background is inverted and red color is used. In https://github.com/w3c/csswg-drafts/issues/6150 the CSS working Group resolved to disallow the chromium behavior. We propose to implement this spec change and bring chromium into compatibility with other browsers.
The existing behavior is incompatible with other browsers (that are themselves compatible) and violates the spec. Author intent is explicitly ignored. We fail at least one WPT (css/css-pseudo/active-selection-018.html). The behavior is inconsistent with other highlight pseudos that allow matching text and background colors.