Since this selector is not officially supported for CSS, removed from CSS3, and not currently in the draft for CSS4 , there is actually not much documentation on how to use the selector.
As defined by the selector, it is designed to override the default text selection colors for the system. Obviously, browsers took it literally. By specifying ::selection , these colors will be immediately overwritten, even if you did not specify them. The problem is that system defaults are not part of CSS. The browser sees your declaration and thinks "ignore system default, use what is in this announcement." Since you do not have the colors indicated there, no colors are applied (the background does not matter, and the color is inherited). Oops, it's hard to say your text is selected, huh?
This is just a theory of what is apparently happening, because, as I said, there really is no documentation about what is actually happening, or what is about to happen.
Honestly, the only way to know for sure is to look at the source code and see what it does when it sees this selector. It might be easier to ask someone from the development team of one of these browsers. In any case, it will still be difficult. Perhaps you can send a bug report, and they can delve into the problem a little more ...
source share