[css-pseudo-4] painting order of find-in-page highlights · Issue #10213 · w3c/csswg-drafts (original) (raw)
- Where should they go in the highlight painting order? We propose that they paint over everything except maybe ::selection, because they reflect an explicit user intent to identify the search string, even more so than ::target-text (see also [css-pseudo] priority of the native highlights #4594).
#3812 suggests adding new highlight pseudos for find-in-page search results, but does not specify the painting order.
We propose that find-in-page highlights paint on top of all existing highlights, for three reasons:
- painting them over ::target-text reflects an explicit user intent to identify the search string that is stronger than ::target-text (for ::target-text, you only need to click on a link)
- painting them over ::selection improves compat with current Firefox behaviour of eagerly moving the selection with the active match (see my comment in #3812; cc @emilio)
- painting them over ::selection improves compat with current Safari behaviour of painting the active match in a special topmost overlay (see my comment in #3812; cc @litherum, @smfr)