You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have Range Selector and Text Position selector. But to let web browser or web browser based reading system to easily serialize selector and highlight the selected segment (for example text) only Range Selector (use CSS Selector) and Text Position Selector are not enough.
Use Range Selector we ony can let select HTML element (#header in above case)
Use Text Position Selector we have to assume the whole html document is serialized by text (in above example it has to be "see if you can highlight me" with index of "h" and "e" in the whole string) but then it is still difficult to locate html element and node for the target text for highlighting purpose.
The text was updated successfully, but these errors were encountered:
Here is a POC to use selector as above to highlight several text inside a random book.
In following example I serialized startSelector to format of <value>;<startNode>;<startOffset> and endSelector to <value>;<endNode>;<endOffset>
@Jeffxz are you asking for something that's not covered by refinedBy? I think the expected way to handle this is to refine the CSS selector by a text position selector so that the position is relative to the start of #header.
There are still some difficulties with measuring offsets that may cross node boundaries or that include text nodes that have code points with multiple code units, so it's not as simple as creating a DOM Range with the offset.
The use case is to let web browser easily serialize and highlight user selected text (to simply use dom range startNode and endNode ).
Imaging we need to create highlight for text fragment "select me" in this HTML element fragment
I propose a selector data model like this
Currently we have Range Selector and Text Position selector. But to let web browser or web browser based reading system to easily serialize selector and highlight the selected segment (for example text) only Range Selector (use CSS Selector) and Text Position Selector are not enough.
Use Range Selector we ony can let select HTML element (
#header
in above case)Use Text Position Selector we have to assume the whole html document is serialized by text (in above example it has to be "see if you can highlight me" with index of "h" and "e" in the whole string) but then it is still difficult to locate html element and node for the target text for highlighting purpose.
The text was updated successfully, but these errors were encountered: