Open Bug 1873711 Opened 1 year ago Updated 1 year ago

Wrong direction for right-to-left text in views and inputs

Categories

(Thunderbird :: Mail Window Front End, defect)

Thunderbird 115
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: mehdi, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0

Steps to reproduce:

Open a text email (not HTML) with some right-to-left text such as Arabic, Persian, or Hebrew. Alternatively open a compose window and copy-paste some RTL text, or open the chat tab and start typing in an input box, or in fact any other input box where users can "generate content" by entering text would do.

Actual results:

RTL text is displayed left-to-right.

Expected results:

RTL text should be displayed right-to-left.

Simple solution: Thunderbird uses Firefox for the underlying UI components, which already support "auto directionality" . It is only necessary to set dir="auto" on any such input element.
I have attached a screenshot to the bug report to demonstrate the issue and the fix better. On the top you see the current view, at the bottom you see the fixed view. I have used the developer console and manually edited the element wrapping my plain text email (it was a pre tag) and added dir="auto" to it.

According to the section on the dir attribute from the HTML spec 1 the algorithm used by dir="auto" is not BiDi (however it gets the job done):

The heuristic used by the auto state is very crude (it just looks at the first character with a strong directionality, in a manner analogous to the Paragraph Level determination in the bidirectional algorithm). Authors are urged to only use this value as a last resort when the direction of the text is truly unknown and no better server-side heuristic can be applied. [BIDI]

Can you attach a sample email (as .eml) that should be rendered the way you describe?

A sample email with Persian text (RTL) for testing.

(In reply to Magnus Melin [:mkmelin] from comment #2)

Can you attach a sample email (as .eml) that should be rendered the way you describe?

Sure. Please see the newly attached "sample.eml".

By the way, I very much like to work on a patch for this issue if anyone is willing to point me in the right direction (I have devleopment environment for TB up and running). The codebase is huge and specifics are probably only known to developers.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: