Intent to Prototype: Find-in-page highlight pseudos

409 views
Skip to first unread message

Delan Azabani

unread,
May 3, 2024, 9:27:20 AMMay 3
to blin...@chromium.org

Contact emails
sche...@chromium.org, daza...@igalia.com

Explainer
https://github.com/Igalia/explainers/blob/66623464ba1f2410a130d687116302b4a30b1148/css/find-in-page/README.md

Specification
None yet; to be specified in https://drafts.csswg.org/css-pseudo/#highlight-pseudos 

Summary
Exposes find-in-page search results to authors as a highlight pseudo-element, like selections and spelling errors. This allows authors to change the foreground and background colors or add text decorations, which can be especially useful if the UA defaults have insufficient contrast with the page colors or are otherwise unsuitable.

Blink component
Blink>CSS

Motivation
Authors would like to customize the highlighted text from find-in-page to have a style consistent with that of the rest of the page. In particular, the existing find-in-page highlights may offer poor contrast, harming accessibility. The find-in-page highlights may also conflict with other highlights on the page, such as syntax highlighting.

Initial public proposal
https://github.com/w3c/csswg-drafts/issues/3812

Search tags
search

TAG review
None

TAG review status
Pending

Risks

Interoperability and Compatibility
None

Gecko: Not yet requested

WebKit: Not formally requested, but feedback on the CSS WG issue and in meetings. Unlikely to implement due to Safari’s unique UI behavior, but not opposed to the spec as long as UAs are allowed to parse but ignore the pseudo. CSS Working Group discussed and is OK with moving forward with prototyping under these conditions.

Web developers: Resolve problems with choosing code syntax highlighting colors https://github.com/w3c/csswg-drafts/issues/3812#issuecomment-1703272181; Explicit request for the feature How to style/detect highlighted boxes generated from browser native search in page - Stack Overflow; Another use case Confuse browsers in-built "find in page" feature - Stack Overflow

Other signals:

WebView application risks
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None

Debuggability
None

Is this feature fully tested by web-platform-tests?
Not yet; tests will be written during the spec and impl process

Flag name on chrome://flags
#enable-experimental-web-platform-features
SearchTextHighlightPseudo

Finch feature name
None

Non-finch justification
None

Requires code in //chrome?
False

Estimated milestones
No milestones specified

Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5195073796177920

This intent message was generated by Chrome Platform Status.

Daniel Bratell

unread,
May 15, 2024, 10:24:10 AMMay 15
to Delan Azabani, blin...@chromium.org

I appreciate that someone is working on this because Chromium has atrociously bad search hit highlights. That said, I wonder if it would be better fixing Chromium than the web. There are a lot of web pages out and this could at best help those with very active ongoing development.

/Daniel

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c447ed4dfd05b588e2afc650277371fd%40igalia.com.
Reply all
Reply to author
Forward
0 new messages