Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Highlight API #540

Closed
1 of 3 tasks
dandclark opened this issue Oct 4, 2023 · 2 comments
Closed
1 of 3 tasks

Custom Highlight API #540

dandclark opened this issue Oct 4, 2023 · 2 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@dandclark
Copy link
Contributor

Description

The custom highlight API provides a way for web developers to style the text of arbitrary text ranges without wrapping them with additional HTML elements. This is useful in a variety of scenarios, including editing frameworks that wish to implement their own selection, find-on-page over virtualized documents, multiple selections to represent online collaboration, or spellchecking frameworks.

Specification

https://drafts.csswg.org/css-highlight-api-1/

Open Issues

In the future there are plans to make this API more powerful by adding user interaction via PointerEvents integration: w3c/csswg-drafts#7447. See list of open issues here: https://github.com/w3c/csswg-drafts/labels/css-highlight-api-1. These are forward-looking and don't block implementation of the current spec.

Tests

https://wpt.fyi/results/css/css-highlight-api

Current Implementations

  • Blink
  • Gecko
  • WebKit

Standards Positions

Gecko: Positive
Safari: Support

Browser bug reports

No response

Developer discussions

Use cases discussed with some developer commentary here: w3c/csswg-drafts#4307. CKEditor had also shown support from the early days of the highlight API explainer. Supportive comments on https://css-tricks.com/css-custom-highlight-api-early-look/.

Polls & Surveys

No response

Existing Usage

Negligible in Chromium: https://chromestatus.com/metrics/feature/timeline/popularity/3984

Workarounds

No response

Accessibility Impact

No response

Privacy Impact

No response

Other

Gecko and Webkit both have experimental implementations of the feature. Blink is the only one shipping in Stable.

@dandclark dandclark added the focus-area-proposal Focus Area Proposal label Oct 4, 2023
@nt1m
Copy link
Member

nt1m commented Oct 7, 2023

I think we should exclude some tests that are tentative or not directly related to the highlight API if this were to be included:

  • css/css-highlight-api/painting/custom-highlight-painting-below-target-text.html
  • css/css-highlight-api/painting/custom-highlight-painting-below-selection.html
  • css/css-highlight-api/painting/custom-highlight-painting-below-grammar.html
  • css/css-highlight-api/painting/custom-highlight-painting-text-shadow.tentative.html (there is some disagreement / discussions around how text-shadow should be painted, Chrome currently does not paint)
@nairnandu
Copy link
Contributor

Thank you for proposing Custom Highlight API for inclusion in Interop 2024.

We wanted to let you know that this proposal was not selected to be part of Interop 2024. This is because we got many more proposals than we could include in this year's project. Note that individual vendors may nevertheless choose to advance work in this area during the forthcoming year. We would welcome this proposal being resubmitted again next year, if necessary.

For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2024!

Posted on behalf of the Interop team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
3 participants