[whatwg] Making selectionDirection platform-independent

Philip Rogers pdr at google.com
Mon Sep 26 09:14:39 PDT 2011


The spec (
http://www.whatwg.org/specs/web-apps/current-work/#dom-textarea/input-selectiondirection)
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?

Philip


More information about the whatwg mailing list