Bidi text cursor navigation

Copper Contributor

Hi,

I have noticed (much to my pleasure) that Edge has departed from the (somewhat non-standard and confusing) behavior of current Chrome with regards to navigating bidi text with the cursor.

The current behavior in Chrome is to follow the visual ordering of the text. Edge seems to have changed this to follow the logical ordering.

I was wondering if this is something that is coming in future versions of chrome or was this a design decision of the Edge team? Where can I find this change documented?

Thanks.

2 Replies

Hi @yzahn, I can take a look at this, but I am not exactly sure what you mean by bidi text.  Are you referencing right to left languages, or something different?  Can you please put an example in the thread and I will try to figure out where the change was made.

Thanks - Elliot

@Elliot Kirk thanks for your reply.

 


Are you referencing right to left languages

well, yes and no...

I am referring to bidirectional text i.e. text which is partly RTL and in part LTR.

If, for example, we have the following text:

abc ZYXW

First word - abc - being LTR, and second word - WXYZ - being RTL, (I am following the convention in the Unicode spec of representing RTL text using uppercase). The logical order of the characters differs from the visual order. Logically, we have: 

abc WXYZ

however seeing as the second word is displayed in a right to left direction we have the visual order of: 

abc ZYXW

When the cursor is situated in the RTL area - as so:

abc ZY|XW

there are 2 methods of translating a right key press. One can move the cursor visually to the right as so: 

abc ZYX|W

which will actually be moving it to the previous character instead of the next character (in the logical ordering). Alternatively, we can always move to the next character in the logical sequence, meaning that a right key press will in reality move the cursor to the left, resulting in this: 

abc Z|YXW

The consensus in most software, and this is Windows' behavior, is to follow the logical ordering, meaning a right key press will move the cursor to the left. 

You can test this by using the following bidi string: 

abc אבגד

paste it into notepad and observe the behavior when browsing with the cursor.

Current versions of Chrome however use the visual ordering - meaning that a right key press will move the cursor to the right. This is a departure from the norm in most software, and personally I find it confusing.

This can be tested by pasting the above string into a chrome input box and moving the cursor through the string.

I noticed (to my pleasure) that the new Edge follows the logical ordering. I am interested in knowing if this change was introduced by the chromium team, and will arrive in a future version of chrome. Or is this a design decision of the Edge team and if so where can I read more about this?

Thanks.