Re: [svgwg] ::selection and other highlights in SVG (#894)

I ran into issues around SVG selection colors when trying to figure out the best solution for https://issues.chromium.org/issues/436810963

I would argue that authors expect the Firefox behavior for text::selection {color: green}, possibly setting fill and/or stroke colors if the originating style (or attributes) have fill and/or stroke.

In general highlight inheritance causes major problems for SVG fill because the initial value is black, not "currentColor" and the spec that is supposed to fix it does not seem to work in practice. I think it's in CSS Colors. So to fix the aforementioned bug I fell back to the originating element rather then the initial value for fill and stroke.

This still leaves open specification of the behavior for text decorations (maybe that exists?) and custom highlights.

-- 
GitHub Notification of comment by schenney-chromium
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/894#issuecomment-3361606835 using your GitHub account


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

Received on Thursday, 2 October 2025 14:58:20 UTC