Closed Bug 274896 Opened 16 years ago Closed 16 years ago

Unexpected behavior in a BIDI text written in an RTL textarea

Categories

(Core :: Layout: Text and Fonts, defect)

x86
Windows 2000
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 207186

People

(Reporter: preacher_public, Assigned: mkaply)

Details

(Keywords: rtl)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

When a bidirectional text (containing both RTL and LTR scripts) is written
inside a textarea or textbox in a web page in FireFox, invisible RTL and LTR
marks seem to be added whenever there is a switch between the LTR and RTL
scripts (hebrew and english in my case). They are treated as characters and
counts as one more letter:  For example, after writing a single LTR character
inside an otherwise RTL text, You have to use backspace three times to delete
it: once for the LTR mark, once for the character, once for the RTL mark. The
same goes for using the arrow keys inside a textarea.

If only a single mark has been deleted and the character remains, the LTR
sequence wont allow the cursor to pass it using the arrow keys. 

The solution should be to manage the LTR marks "behind the scenes" and not to
let users delete them. So backspacing should just delete the character before
it, leaving the LTR mark intact.

This behavior is not entirely consistent, depending on using the "switch text
direction" command for the right-click menu, whether the page or textarea tag
have a DIR="RTL" property, and the exact sequence the letters have been entered in.

There is another unexpected behavior that might be related: when using the arrow
keys to forward through and RTL text, when you get to the end of the text the
cursor jumps to the beginning of the textarea or sometimes just the last sentece. 

Reproducible: Always

Steps to Reproduce:
1. Create a new webpage with a "textarea" tag.
2. Open the page, right click inside the textarea and choose "switch text
direction".
2. switch to an RTL language, write some text, switch to a latin script, write
some text, and return to the RTL language
3.backspace to delete the text, and use arrow keys in the text

Actual Results:  
when passing from RTL to LTR an extra backspace is needed. When using the arrow
keys, the LRT text may block the cursor from moving. When pressing the arrow key
at the end of the text in the textarea, the cursor returns to the beginning.

Expected Results:  
Only visible characters are deleted. Arrow keys should move the cursor freely.
At the end of the text the cursor should stop.
Component: General → Layout: BiDi Hebrew & Arabic
Product: Firefox → Core
Summary: Unexpected behavior in a BIDI text written in an RTL textarea → Unexpected behavior in a BIDI text written in an RTL textarea
Version: unspecified → Trunk
Most (but perhaps not all) of the issues raised here are covered by bug 207186.

After making sure that everything is covered there (adding testcases if
necessary), this bug should probably be closed as a duplicate.
Assignee: firefox → mkaply
QA Contact: firefox.general → zach
This is indeed a dupe of Bug 207186. Reporter, please add your analysis and
suggestions there.

Prog.

*** This bug has been marked as a duplicate of 207186 ***
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Mass-assigning the new rtl keyword to RTL-related (see bug 349193).
Keywords: rtl
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: zach → layout.fonts-and-text
You need to log in before you can comment on or make changes to this bug.