Re: [Selection] Support of Multiple Selection (was: Should selection.getRangeAt return a clone or a reference?)

On 01/12/2015 07:59 PM, Ben Peters wrote:
> Multiple selection is an important feature in the future.

Indeed, there are many important use cases for it.

Here are some use cases that are implemented using multi-range selections
in Gecko today:
  * visual selection of bidirectional text
  * selecting table columns
  * selecting multiple fragments of arbitrary content (just hold CTRL)
  * selection with disjoint unselected islands due to CSS user-select:none
  * mapping spell-checking errors
  * highlighting matched words for "Find in Page"
etc

> I do not believe “everyone wants to kill it” is accurate. I agree with
> Olivier that it’s crucial to a full-featured editor. We don’t want to
> make sites implement this themselves.

Strongly agreed.  This is complicated to implement correctly and can be
very slow if you're not careful.  It should be implemented in the UA.

Since Ranges are well specified, including how they stay valid under
DOM mutations (DOM spec), I don't see why we should re-invent the wheel
here.  Especially since there is no alternative proposal on the table.

BTW, this topic was discussed a while ago on this list:
http://lists.w3.org/Archives/Public/public-webapps/2014AprJun/0620.html
http://lists.w3.org/Archives/Public/public-webapps/2014AprJun/0627.html


/Mats

Received on Tuesday, 13 January 2015 22:06:13 UTC