Re: [web-annotation] white space normalisation

Yes, just followed up to same the same about `Selection` as you.

I am not sure I favor assuming that the `Selection` API is used to 
stringify a selection. In Hypothesis, for instance, I implemented the 
text quote selector by inspecting the text values of the ranges 
retrieved from `getSelection().getRangeAt(n)` for `0 <= n < 
getSelection().rangeCount`.

In the past, the Selection API was used, but it made anchoring more 
compute intensive. The easiest way to guarantee the same normalization
 was to traverse the entire DOM and select every node. The alternative
 used now can just call `document.body.textContent` and let the 
browser return all the text content efficiently.

I suppose both approaches seem equally valid to me, I just wonder if 
we really gain much by specifying additional normalization.

-- 
GitHub Notification of comment by tilgovi
Please view or discuss this issue at 
https://github.com/w3c/web-annotation/issues/221#issuecomment-221116720
 using your GitHub account

Received on Monday, 23 May 2016 22:36:45 UTC