[whatwg] getSelection().modify() in vertical writing modes

Ryosuke Niwa rniwa at webkit.org
Wed Jun 15 18:55:14 PDT 2011

On Wed, Jun 15, 2011 at 5:50 PM, Justin Garcia <justin.garcia at apple.com>wrote:
> I think using a Selection object method to emulate arrows keys is strange.

The use case of getSelection().modify() is still unclear [1].

Why not provide a general way to emulate the arrow keys if we think that's
> useful–if the focused area is an editable document, then those events can
> result in selection changes.

I guess developers already have a way of emulating arrow keys by sending
keydown/keypress events.  It's just that WebKit's implementation is broken

It seems like maintaining the semantics of 'character' and 'line' is the way
to go then.  i.e. modify('move', 'right', character') moves caret visually
downwards and modify('move', 'right', 'line') moves caret visually to the
left (to the next line) in LTR text in a block with writing-mode:

- Ryosuke

[1] "selection.modify behavior across platforms" (
[2] "keyboard events created with DOM have keyCode and charCode of 0; thus
they aren't handled correctly internally"

More information about the whatwg mailing list