Closed Bug 308023 Opened 19 years ago Closed 19 years ago

Bidi: Caret positioned incorrectly after deleting last character of reverse-direction text and then typing

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: uriber, Assigned: uriber)

References

()

Details

(Keywords: fixed1.8.1)

Attachments

(2 files)

In the top (RTL) textarea of the following testcase:
https://bugzilla.mozilla.org/attachment.cgi?id=193730

1. place the caret inside "English"
2. move to the right of the "h" (using right-arrow)
3. press backspace to delete the "h"
4. type "h" (or any other LTR character).

The character you typed appears in the correct place, but the caret appears to
the left of the "E". Typing more LTR text leaves the caret to the left of the "E".

The problem here is that the deleting sets the hint to HINTRIGHT, so later the
typing sets the caret bidi level according to the following frame, which is RTL.
Attached patch patchSplinter Review
Set the hint to HINTLEFT whenever a character is typed.
This also takes care of the HTML case (the same code is reached).

It also fixes an inconsistency in newlines in the regular LTR case:
When inserting blanks before the last word on a line, which cause that word to
wrap to the next line, the position of the caret (at the end of the current
line or the beginning of the new one), currently arbitrarily depends on what
was the last arrow key used (left or right) before inserting the spaces.
Attachment #195653 - Flags: superreview?(roc)
Attachment #195653 - Flags: review?(roc)
Status: NEW → ASSIGNED
Remind me again exactly what HINTLEFT means?
(In reply to comment #2)
> Remind me again exactly what HINTLEFT means?

HINTLEFT means "display the caret at the end of the previous frame" as opposed
to "at the beginning of the next frame", when the caret is logically between two
frames.
This testcase demonstrates the non-bidi bug described in comment #1, which is
also fixed by the proposed patch.
Attachment #195653 - Flags: superreview?(roc)
Attachment #195653 - Flags: superreview+
Attachment #195653 - Flags: review?(roc)
Attachment #195653 - Flags: review+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
No longer blocks: 310227
Target Milestone: --- → mozilla1.9alpha
This was fixed on the 1.8 branch by the patch on bug 118629.
Keywords: fixed1.8.1
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.

Attachment

General

Creator:
Created:
Updated:
Size: