[whatwg] Control over selection direction

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