Re: [w3c/selection-api] Support multi range selection (#41)

@MatsPalmgren Sorry if I was unclear.  I meant the list should contain 1) nodes, and 2) partially-selected CharacterNodes.  I would also want the list to be live, as Ranges currently are, not a static array.  A method that takes a callback would also work, but a list-like structure would be more flexible if we supported all array methods (like forEach but also filter, etc.).  Then you don't need to have a special-cased selector argument, you can do selectedNodes.filter(n => n.matches ? n.matches("...") : false).forEach(...), and any other filtering or other operations you like.

@rniwa This isn't a problem with the proposed API, it's orthogonal.  If authors want to implement an editor, more APIs will be needed, such as to split up elements while preserving the selection properly.

-- 
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/41#issuecomment-290084358

Received on Wednesday, 29 March 2017 13:09:40 UTC