W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2011

[whatwg] Control over selection direction

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Thu, 13 Jan 2011 09:44:41 -0800
Message-ID: <AANLkTinCmKtPTV2en0-R4J9E=H50X3M2DaVs5ZNa-mV7@mail.gmail.com>
2011/1/13 Kornel Lesi?ski <kornel at geekhood.net>
>
> If not, maybe methods to save/restore selection or modify content without
> removing selection would be better? (this would allow browsers to support
> multiple selected ranges, block selection in multiline inputs, etc.)
>
> var previousSelection = input.currentSelection; // opaque object describing
> properties of selection
> input.value = 'foo';
> input.currentSelection = previousSelection;
>

I like the idea.  Presumably, we'll have an explicit clone() method on
window.getSelection().  This will allow methods like modify() to be executed
without having to modify the actual selection, and will be a big step
forward for some editing apps like Google docs.

- Ryosuke
Received on Thursday, 13 January 2011 09:44:41 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:29 UTC