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

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

From: Ojan Vafai <ojan@chromium.org>
Date: Wed, 15 Jun 2011 16:19:40 -0700
Message-ID: <BANLkTimF8rbEerMMfvWD35YaJVhHX0kA_tz5tkRt3snRGuH_iQ@mail.gmail.com>
It's not clear to me what forward/backward should do, but left/right should
do the same thing as using the left/right arrow keys. What do those do in
vertical writing mode?

On Wed, Jun 15, 2011 at 4:13 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:

> Hi all,
>
> WebKit would like to support visual caret movements in vertical writing
> modes [1].  How should getSelection().modify() support this new behavior?
>  In particular, what getSelection().modify('move'/'extend', 'left'/'right',
> 'character') should do?
>
> One possibility is that getSelection().modify('move'/'extend',
> 'left'/'right', 'character') will move caret visually left or right,
> thereby
> moving between lines in vertical writing mode.  This way, the semantics of
> moving left and right is preserved.  However, the semantics of moving by
> 'character' is lost.  In this case, getSelection().modify('move'/'extend',
> 'left'/'right', 'line') should move caret visually up or down (moving one
> character at a time).
>
> Now, in horizontal writing modes, 'left' and 'right' are used to move caret
> in visual order (in the sense of bidirectional text) and 'forward' and
> 'backward' are used to move in logical order.  However, swapping the
> meaning
> of 'character' and 'line' for 'forward' and 'backward' is quite confusing
> as
> they used to walk DOM in logical order, and didn't depend on how characters
> are presented.
>
> On the other hand, if we left modify() intact - i.e.
> getSelection().modify('move'/'extend', 'left'/'right', 'character') move
> caret in visual order (i.e. visually up or down) in vertical writing mode
> - then scripts need to manually detect whether the content in which the
> caret resides is in vertical writing mode or not and change granularity
> between 'character' and 'line' in order to emulate arrow key movements.
>
> [1] http://dev.w3.org/csswg/css3-writing-modes/
>
> Best,
> Ryosuke Niwa
> Software Engineer
> Google Inc.
>
Received on Wednesday, 15 June 2011 16:19:40 UTC

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