This proposal was inspired by this issue in Editing discussions.
Highlight API allows web developers to style arbitrary range objects without causing DOM updates of the view.
Currently, browsers do not provide this functionality which forces web developers to modify DOM in order to achieve desired effect. This increases complexity and causes unexpected behaviors and site crashes when third party extensions are trying to modify main document’s DOM.
The 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.
We would love to get thoughts on this from the community on the shape of the API, some open questions and use cases.
Link to the Explainer.