[whatwg] Request for new DOM property textarea.selectionText

Ryosuke Niwa rniwa at webkit.org
Sun Apr 29 23:22:26 PDT 2012

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:
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

More information about the whatwg mailing list