[whatwg] Request for new DOM property textarea.selectionText

On Sun, Apr 29, 2012 at 12:38 AM, Aryeh Gregor <ayg at aryeh.name> wrote:
>
>  > In this case, we have an API, namely document.execCommand, supported by
> two
> > major browser engines (for years) that provides more or less the same
> > functionality as the proposed API.
>
> delete works in IE as well as WebKit.  insertText (which is what would
> be needed for this feature) is WebKit-only, in both plaintext and
> richtext.
>

That's unfortunate. FWIW, your editing spec defines InsertText:
http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#the-inserttext-command
so we could make it work with input/textarea elements.

On one hand, being able to replace a part of text inside input/textarea
will be a useful feature. On the other hand, I don't think it'll be
efficient per se because the easiest implementation of this API is to
serialize the value, string-replace, and then put it back to
input/textarea. Making it work efficiently requires a bit of work (at least
in WebKit).

- Ryosuke

Received on Sunday, 29 April 2012 23:22:26 UTC