[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
[2].

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:
vertical-rl.

- Ryosuke

[1] "selection.modify behavior across platforms" (
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-March/031000.html)
[2] "keyboard events created with DOM have keyCode and charCode of 0; thus
they aren't handled correctly internally"
https://bugs.webkit.org/show_bug.cgi?id=16735



More information about the whatwg mailing list