W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: [Selection] Should selection.getRangeAt return a clone or a reference?

From: Olli Pettay <olli@pettay.fi>
Date: Wed, 07 Jan 2015 00:44:43 +0200
Message-ID: <54AC655B.2030301@pettay.fi>
To: Webapps WG <public-webapps@w3.org>
On 01/07/2015 12:32 AM, Ryosuke Niwa wrote:
> https://github.com/w3c/selection-api/issues/40
>
> Trident (since IE10) and Gecko both return a live Range, which can be modified to update selection.  WebKit and Blink both return a clone Range so that any changes to the Range doesn't update the selection.
>
> It appears that there is a moderate interest at Mozilla to change Gecko's behavior.  Does anyone have a strong opinion about this?


I don't have a strong opinion on this, although live Range can be rather nice thing when one wants to change the selection.
But implementing the live-ness properly can be somewhat annoying - except that engines need to internally track DOM mutation inside
selection anyway, so maybe not so bad after all.
Perhaps speccing the special cases (like when one makes Range to point to detached dom subtree) would be enough?

But as I said, I don't have strong feelings about this.

-Olli



>
> - R. Niwa
>
>
Received on Tuesday, 6 January 2015 22:45:10 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:25 UTC