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

[whatwg] Request for new DOM property textarea.selectionText

From: Aryeh Gregor <ayg@aryeh.name>
Date: Sun, 29 Apr 2012 10:38:26 +0300
Message-ID: <CAKA+Axn+57m8Jr=f46QHrS8PAk8EMyuu+Unooh=1xvYb-ONXZQ@mail.gmail.com>
On Sun, Apr 29, 2012 at 10:29 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> That sounds like a tangential issue. We can easily extend execCommand to
> support arbitrary range(s) since such a feature is also valuable in richly
> editable areas.

Ranges don't exist in plaintext areas.  How would you get a Range
object that selects text in a textarea?  That's why we have separate
.selectionStart, .selectionEnd, etc. properties to start with.

> 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
Received on Sunday, 29 April 2012 00:38:26 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:12 UTC