I was reading documentation about the recently-available-in-most-browsers CSS Highlight API. It seems like it could be cool to figure out a path to rendering ProseMirror decorations (or something like them) as CSS Highlights — for one, it’d mean the potential to style text ranges without creating additional DOM structure for features like spell check errors.
It seems like one challenge here is that the highlights API leverages existing document range creation API’s to do its thing — and so we would need some way to keep a set of highlights up to date for a given DOM structure, after the DOM has been rendered by ProseMirror but with some awareness of the relationship between document positions and corresponding DOM structures. I haven’t really started hacking the ProseMirror internals to see if something like this is already possible using plugin hooks — but figured I’d start a thread here, in the event that someone else has been thinking about this!