Re: browsers + arrow keys + bidi

Actually,having thought about it a bit more, I think we are seeing from different points of view with respect to mentally allocating the forward and back operations to the arrow keys. Once I have mentally allocated the keys to forward and back I no longer think about left or right. I think about forward and back wrt to the direction of the text.

So, an alternate way of thinking about it, wrt text selection, is:

in a ltr textbox with bidi text: right arrow becomes forward and left arrow becomes back
in a rtl textbox with bidi text: left arrow becomes forward and right arrow becomes back

I am ok with this as long as all browsers operate the same way. So, for this scheme, Firefox is the odd one out.

Now I would like to go one step further. Firstly though a preamble. I will use lower case latin to represent ltr letters and uppercase latin to represent rtl letters.

Given the string abZYXcd a bidi person (someone familiar with reading bidi text) would read it in the order abXYZcd which is the memory order.

For the following forget about text selection

So, for cursor movement I think the arrow keys should move the cursor in memory order but the current situation is that cursor movement in bidi text is purely ltr or rtl ie cursor movement is in display order.

A reasonable compromise might be a browser switch where the user can select whether they want cursor movement by arrow keys to be in memory order or display order.

André Schappo

On 1 Mar 2018, at 18:52, Andre Schappo <<>> wrote:

Ah😀 Yes. Good point.

Here is a more detailed explanation of my thinking. I will stick with forward for right arrow key and back for the left arrow key.

Again using the last 2 text boxes in my jsfiddle and forgetting about text selection at the moment, forward will move the cursor through the text from left to write and back will move the cursor from right to left. This takes no account of bidi. It is working on display order.

Now onto selection using shift and forward and back arrow keys. This is where we now need to take account of bidi. Forward key moves away from the beginning of the text towards the end of the text string. Back key moves away from the end of the text string towards the beginning of the text string. This is done in memory order and not display order. So, whether the text is English or Hebrew the forward and back keys are behaving correctly in Firefox (IMHO).

Using Firefox, I will give 2 examples where my cursor starts between b and c.

ltr textbox: shift forward forward forward will select cdא

rtl textbox: shift forward forward forward will select cdא

Both are working as I think they should work and are culturally correct in both cases.

If I place my cursor within the hebrew and shift forward to select, it is culturally correct as it is moving towards the end of the Hebrew text.

André Schappo

On 28 Feb 2018, at 16:43, Phillips, Addison <<>> wrote:

Why do you prefer the way Firefox behaves?

First, Firefox clearly has a cursor selection bug. Cursor-selecting in a single direction should end up with the whole string selected and it doesn’t in FF.

But more to the point: why do you think “right” means “forward”? In an RTL context (which implies an RTL language or culture), right means *back*. Your attribution of “forward” or “back” to the directions “left” and “right” is culturally/linguistically linked. Otherwise, RTL users constantly have to think about the fact that the “forward” arrow points in the wrong direction!


From: Andre Schappo []
Sent: Wednesday, February 28, 2018 2:57 AM
To: www International <<>>
Subject: browsers + arrow keys + bidi

When dealing with bidi text I think of right arrow key as forward arrow and left arrow key as back arrow.

Looking at the last 2 textboxes in the results window at<> The first of these 2 is ltr and the last is rtl.

Now select some text in the ltr textbox using shift and forward arrow, say starting at the boundary between b and c. All the browsers behave as I expect. They are all working on memory order and they are all selecting the text I expect.

It is with the rtl textbox that there are differences. Of the browsers I tried, Firefox is the only one to behave as I expect ie shift + forward behaving the same and selecting the same text as in the ltr textbox. With the other browsers I tried, I had to use back arrow to select the same text.

I prefer the way Firefox behaves. Is there a standard for browser behaviour under these circumstances?

André Schappo

🌏 🌍 🌎
André Schappo

Received on Friday, 2 March 2018 11:53:57 UTC