At investigating selection API behavior, I realized that non-Gecko engines don't support multiple selection.

For example, document.getSelection().addRange(somethingNewRange) does nothing when the selection has a range.

You can see the behavior with following testcases:
1. in editable content: https://jsfiddle.net/d_toybox/9Lrs62po/3/
2. in static content: https://jsfiddle.net/d_toybox/9Lrs62po/2/

Personally, I like the multiple selection feature when I copy a lot of fragments of a document. However, who needs this feature in editor? Supporting multiple selection in editor makes our editor code complicated. For example, when web apps try to make the text content bold, editor needs to do it at every selection range. If selection is modified during handling something, loop for selection ranges may cause crash (I've seen a lot of similar crash bugs).

So, it might be better to stop supporting multiple selection only in editor if the feature is not so loved by users.

I filed a bug for discussing this issue here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1323681

Feel free to comment anything.

Thanks in advance.

--
Masayuki Nakano <masay...@d-toybox.com>
Manager, Internationalization, Mozilla Japan.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to