W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2012

[whatwg] Request for new DOM property textarea.selectionText

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Sun, 29 Apr 2012 23:22:26 -0700
Message-ID: <CABNRm61O=Qpp1AO=gpRhteM=2fYrmMCjS2Gz1kXUVG_3xX4M8A@mail.gmail.com>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:07 GMT