Re: [csswg-drafts] [css-highlights] Highlight cascade behavior for shadows is rather unfortunate. (#13376)

note that per [#highlight-painting](https://drafts.csswg.org/css-pseudo/#highlight-shadows), originating shadows draw underneath highlight backgrounds, and some highlight shadows draw underneath other highlight backgrounds. that makes this issue less problematic when the highlight styles include a background, but i think it’s still worth solving.

no matter what, ‘text-decoration’ should be additive in highlight pseudos, because having spelling/grammar squigglies play nice with <a> and <del> is important. authors may already be familiar with [decoration propagation](https://drafts.csswg.org/css-text-decor/#line-decoration) outside of highlight pseudos, and can continue to think of highlight pseudos as in-flow children of a decorating box.

do we have any insight into how authors want to use ‘text-shadow’ in highlight pseudos? if no one uses ‘text-shadow’ in a way that expects it to be additive, and some authors say [one of the most helpful uses of ::selection is for removing ‘text-shadow’](https://web.archive.org/web/20240617162604/https://css-tricks.com/almanac/selectors/s/selection/), then maybe we can:

1. make ‘text-shadow’ on highlights override originating shadows, rather than adding them

2. plus… make originating shadows draw over all highlight backgrounds? this is what Gecko does and what Blink used to do, and from what i remember it would make the Chromium painting impl a bit simpler

3. or even… make originating shadows automatically get removed when text is highlighted? this is more radical, but does anyone actually want originating shadows to stay when text is highlighted?

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


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

Received on Wednesday, 13 May 2026 04:06:57 UTC