[whatwg] Standard method to get/set caret position

On Fri, 12 Nov 2004, Greg Kilwein wrote:
> > >
> > > The second situation is an application that would like to highlight 
> > > text in a text box or textarea for the purposes of a spell check, 
> > > thesaurus, or search-and-replace operation.
> > 
> > In this case you want more of a highlighting API than a selecting API, 
> > though, right?
> 
> Yes.  If it were possible, highlighting could be accomplished by styling 
> a portion of the text in the textbox or textarea, which gets into the 
> realm of the rich text box.

I think we should punt on this for now, since the browser vendors have 
been so slow at implementing Web Forms 2 -- no point getting so far ahead 
of them that they can't even fathom doing everything the spec says.

I expect what we'll eventually do is introduce an API to do context- 
sensitive styling of textarea contents, so you can do things like source 
code syntax highlighting. This would also take care of your use case.

Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 6 January 2009 03:49:25 UTC