#584: CSS Custom Highlight API Module Level 1
Discussions
2021-01-Kronos
- 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 existingHighlight
with the same name is registered
OpenedDec 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:
We'd prefer the TAG provide feedback as 🐛 open issues in our GitHub repo for each point of feedback