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

[whatwg] Request for new DOM property textarea.selectionText

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 29 Apr 2012 02:21:31 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1204290217470.19700@ps20323.dreamhostps.com>
On Sat, 28 Apr 2012, Ryosuke Niwa wrote:
> On Sat, Apr 28, 2012 at 9:30 AM, Ian Hickson <ian at hixie.ch> wrote:
> > >
> > > I think reusing execCommand is better than adding new method for 
> > > input/textarea elements for each new feature request like this one.
> >
> > If it was a contentEditable feature I'd reluctantly agree (reluctantly 
> > because execCommand is a terrible API), but I really don't see why 
> > execCommand() would work on input controls.
> 
> Because they're all "editing" features.

They're very different in most sense, why should they be the same in this 
one? (They have different DOM representations, different UI, different 
events, different selection APIs, most of the execCommand()s only apply to 
structured editors which neither <input> nor <textarea> have, etc...)


> How do we know someone won't suggest adding things like 
> input.insertParagraph()

Well they can suggest it, but since text inputs are single-line editors, 
they wouldn't get very far.


> or input.deleteSelectedText(), etc...

That's one of the features setRangeText supports:

   input.setRangeText('');

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Saturday, 28 April 2012 19:21:31 GMT

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