Re: [csswg-drafts] [css-pseudo-4] Add highlight pseudo for in-page search (#3812)

I find myself really wishing for this when interacting with the ECMAScript specification, which supports its own highlighting of variables in algorithms. For example, visit https://tc39.es/ecma262/multipage/notational-conventions.html#sec-returnifabrupt , click on the italicized _argument_ to highlight all instances of that variable in the section, and then use the native browser find-in-page facility to search for "arg". On my machine, the styling for matching selections is almost completely indistinguishable from that of the page-provided highlights—in fact, the _only_ difference I can discern is slight bolding of the former, although technically the background color is `#ffff00` vs. `#ffff33`:
![screenshot showing nearly-identical native and custom highlighting](https://github.com/w3c/csswg-drafts/assets/1199584/8944751c-4233-4e73-826b-03fc6a28e591)

Since there is no standard for in-page match styling, there is no color that the custom functionality could use which would be guaranteed to not have this issue. So what's really missing here is a way for the page to set that styling along with the custom highlighting via something like the above-mentioned `::active-search` and `::inactive-search`.

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


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

Received on Friday, 1 September 2023 20:12:35 UTC