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

> It is very well specified how this should work

Yes, it's very well specified. The problem is that that specified behavior doesn't work as (author) expect in many cases when elements are moved around for editing purposes.

Also, when one of the ranges are modified. For example, let's say we have multiple ranges like: `<b><i>[foo]</i>ba[r</b>baz]`.  If we wanted to unbold this multi-range selection, then we must first *split* the outer `b` and get to `<b><i>[foo]</i></b><b>ba[r</b>baz]`. Ordinary ranges aren't going to be adjusted like that. Because the very first step involves detaching the first half or the second half of `b`, and that would immediately moves both ranges to before b as in: `[]<b>ba[r</b>baz]` or `<b><i>[foo]</i></b>[baz]` respectively. Inserting back the content would result in: `[]<b><i>foo</i></b><b>ba[r</b>baz]` or `<b><i>[foo]</i></b><b>bar</b>[baz]` respectively. Neither results is satisfactory for handling the second range.

-- 
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-289924788

Received on Tuesday, 28 March 2017 22:32:17 UTC