#584: CSS Custom Highlight API Module Level 1

Visit on Github.

Opened Dec 8, 2020

你好 TAG! 吃饭了吗?

I'm requesting a TAG review of CSS Custom Highlight API Module Level 1, which was recently published as a FPWD.

The Custom Highlight API extends the concept of highlight pseudo-elements (see CSS Pseudo-Elements 4 §3 Highlight Pseudo-elements) by providing a way for web developers to style the text of arbitrary Range objects, rather than being limited to the user agent defined ::selection, ::spelling-error, and ::grammar-error. 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 selection to represent online collaboration, or spellchecking frameworks. The Custom Highlight API provides a programmatic way of adding and removing highlights that do not affect the underlying DOM structure, but instead applies styles to text based on range objects, accessed via the ::highlight() pseudo element.

Further details:

  • I have reviewed the TAG's API Design Principles
  • Relevant time constraints or deadlines: Nothing in particular
  • The group where the work on this specification is currently being done: CSSWG
  • The group where standardization of this work is intended to be done (if current group is a community group or other incubation venue): CSSWG
  • Major unresolved issues with or opposition to this specification: No known opposition, event part still missing
  • This work is being funded by: Bloomberg, Microsoft, Apple

We'd prefer the TAG provide feedback as 🐛 open issues in our GitHub repo for each point of feedback

Discussions

2021-01-Kronos

Minutes

  • We talked about the suitability of using this API for syntax highlighting
  • Why is HighlightsRegister setlike and not maplike? Poor developer experience if one needs to iterate over it to see if an existing Highlight with the same name is registered
2021-03-15

Minutes

Bumped waiting for feedback from CSSW

2021-05-Arakeen

Minutes

Issue fixed, review closed!