[whatwg] Control over selection direction

> Would you use it in cases other than restoring previous selection?

My typical use case is that I mess with the content of the input, and
then restore the selection. For example, after adding three characters
to the front, I then restore selectionStart and selectionEnd by adding
three to their original values. It seems that simply saving and
restoring a selection does not address this case.

(On top of that, I'd argue that my proposal is more 'basic', giving
programmers direct control over the DOM, rather than a convenient
interface that breaks down for corner cases. See Microsoft's original
selection API for an interesting example of a convenient API like
that.)

Received on Thursday, 13 January 2011 10:54:38 UTC