W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2011

[whatwg] Making selectionDirection platform-independent

From: Philip Rogers <pdr@google.com>
Date: Mon, 26 Sep 2011 12:14:39 -0400
Message-ID: <CAJgFLLtgAYiqrTZrMZt5=TyW=UQGE1UMBhv0yenMkorbxtUNRg@mail.gmail.com>
The spec (
currently allows for platform-specific differences in selectionDirection
that limit its usefulness. Tightening the requirements to be
platform-independent will allow selectionDirection to be used for
determining the caret location in a selection.

On Windows, selectionDirection indicates which end of the selection the
caret should be placed. On Mac, selectionDirection works similarly when the
selection is modified using shift+arrow key, but the spec does not require
the same functionality when clicking and dragging a selection. This leaves
no cross-platform way to determine the correct caret location! It looks like
editors using a textarea (such as codemirror) are currently working around
this by not drawing a cursor when there is a selection.

Are there arguments against making selectionDirection explicitly "forward"
or "backward" if the user modifies the selection, regardless of platform?

Received on Monday, 26 September 2011 09:14:39 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:36 UTC