Re: [w3c/selection-api] Add Selection/Range methods based on anchestor element (#102)

> What do you want to point with if not cursor/focus?

I think the best way to answer this is to imagine a world where querySelector or getElementById would not just give you a reference to a node, but also give it input focus.

Creating variable references to caret locations, or selection-like objects with one or maybe more ranges between caret locations, would be super useful. Using them to also get or set input selection is of course one common use case, a bit like invoking .focus() on an element.

Having character / code point / grapheme iterators you could place or move back and forth at/to indexed positions in one or more of of those units, compare with each other for equality, before/after, and query for what their next and previous character / code point / grapheme is would be even more useful, like a NodeIterator or TreeWalker, but for text, and hopefully with a friendlier api.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/selection-api/issues/102#issuecomment-469638204

Received on Tuesday, 5 March 2019 11:02:47 UTC