I'd like to try to clarify how forced-color-adjust
should apply to highlight pseudos.
In crbug.com/1309835, @andruud raised the question of how forced-color-adjust:preserve-parent-color
should interact with the special definition of currentColor
used with highlight inheritance. Normally preserve-parent-color
has currentColor
compute to the used value of the parent's color, but with highlights it's not so clear what this value should resolve to. Making it dependent on which highlight overlays are active could be problematic as that info may not be readily available until paint-time.
A simple way to resolve any strangeness could be to just treat forced-color-adjust:preserve-parent-color
as forced-color-adjust:none
for highlights. The motivating use case for preserve-parent-color
involving SVG icons doesn't seem to be applicable to highlight pseudos as far as I can tell.
Considering things more broadly, does it make sense to allow forced-color-adjust
in highlight pseudos at all? It is not one of the properties listed at https://drafts.csswg.org/css-pseudo-4/#highlight-styling, but Chrome allows it to be used with ::selection
and the other highlight pseudos when --enable-blink-features=HighlightInheritance
is enabled. Example here. (When HighlightInheritance is not enabled, Chrome looks like it always ignores forced colors for ::selection
pseudos, which seems clearly wrong).
Perhaps highlights should always just use the forced-colors state of the originating element. Does it actually make sense to allow authors to opt out of forced colors for highlights but not the element containing the underlying text? Or vice versa?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3