[whatwg] Standard method to get/set caret position

On 31 Aug, 2004, at 5:36 AM, martijn wrote:
> ...
> It seems to me that the selection is the position of the cursor, not? 
> When you press the left arrow key, the selection collapses and the 
> cursor is at the start of where the selection was. With the right 
> arrow key, the selection collapses and the cursor is at the end of 
> where the selection was. Why should there also be a caret?

Because native Windows editing controls have both -- a selection, and 
then a caret at either the start or the end of the selection, depending 
on which direction the selection was made in. (The benefit is that it 
lets you see which end of the selection Shift+Left/+Right/+Up/+Down 
will alter; the drawbacks are that Left/Right are less likely to do 
what you want, and that the blinking caret falsely suggests that typing 
will not replace the selection.)

But such a caret is not present when a selection is made in MS Word, 
nor in any Mac software I've seen, nor in MSIE on Windows or Mac OS, 
and nor in Mozilla on any platform.

<http://bugzilla.mozilla.org/show_bug.cgi?id=41077#c22>
<http://bugzilla.mozilla.org/show_bug.cgi?id=64643>
<http://bugzilla.mozilla.org/show_bug.cgi?id=78949>

However, I'd be uncomfortable with any API that prevented the designers 
of a future OS (for example Jef Raskin's "Humane Environment", if that 
ever becomes an OS) from deciding that they will have such a caret.

-- 
Matthew Thomas
http://mpt.net.nz/

Received on Monday, 30 August 2004 15:07:58 UTC