I am working on a viewer application which displays static HTML in WebKit and allows user to select and highlight text.
My approach has been to keep the static HTML document intact and save the highlights in a separate location. Rangy works great for serializing selections so that they can be stored and reapplied once the application launches again.
However using the CSS Class Applier Rangy extension to mark the highlighted sections, changes the DOM structure of the document and thus invalidates all previously serialized ranges.
Is it possible to apply a CSS class to the user selection without changing the DOM structure?
Thanks a lot!