Closed Bug 209430 Opened 21 years ago Closed 21 years ago

Ctrl+Delete and Ctrl+BackSpace delete words in the wrong direction

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bugzillamozilla, Assigned: mkaply)

References

()

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.3) Gecko/20030314
Build Identifier: Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.3) Gecko/20030314

In right-to-left forms, pressing Accel+Delete deletes backwards and
Accel+BackSpace deletes forwards - it should be the opposite.

Reproducible: Always

Steps to Reproduce:
1. Open http://oren.gomen.org/mozilla/textareas.html
2. Place the caret between the two words
3. Press Accel+Delete (Ctrl+Delete in Windows)
Actual Results:  
The first word is deleted (backward delete)

Expected Results:  
The second word should be deleted (forward delete)

Repeat test with Accel+BackSpace -> second word is deleted instead of the first one.

Tested with Mozilla 1.4rc1, 1.2.1 and Firebird 0.6 (WinXP Pro) and Mozilla 1.3
(BeOS)

Prog.
Confirming. 
Status: UNCONFIRMED → NEW
Ever confirmed: true
prognathous, please add the words "ctrl" and "word" to the summary, so this bug
will be easier to query for.
Since this issue is more likely to be noticed by Windows and *nix users, I just
changed the term Accel in the summary to Ctrl. It is not likely that MacOS and
BeOS users will search for such a bug anyway, as word-deletion is not a standard
behavior under these systems, and since there certainly isn't any standard
modifier key for it.

Prog.
Summary: Accel+Delete and Accel+BackSpace delete in the wrong direction → Ctrl+Delete and Ctrl+BackSpace delete words in the wrong direction
Attached patch Patch v.0 (obsolete) — Splinter Review
Suggested patch, not yet tested.
Attached patch Better patchSplinter Review
This works better.
Attachment #138692 - Attachment is obsolete: true
Attachment #138742 - Flags: review?(daniel)
Attachment #138742 - Flags: superreview?(dbaron)
Comment on attachment 138742 [details] [diff] [review]
Better patch

sr=dbaron.  I certainly wouldn't object if you went with the shorter but
probably slightly more cryptic

selCont->WordMove((caretBidiLevel & 1) == 0, PR_TRUE);

and

selCont->WordMove((caretBidiLevel & 1) != 0, PR_TRUE);

But it's certainly OK with me if you don't like that. :-)
Attachment #138742 - Flags: superreview?(dbaron) → superreview+
The bug is still not fixed in one specific (and rather rare) scenario:
A. Input language has just been switched to a language with opposite direction
than the current textarea (e.g. English input in an RTL textarea)
-and-
B. The users hasn't moved the caret between the language switch and the deletion.

Steps to reproduce:
1. Make sure that the input language is Hebrew.
2. In the first textarea (RTL), put the caret in the begining of the second word.
3. Switch the input language to English
4. Press Ctrl+Delete

Actual results:
The first word is deleted.

Expected results:
The second word should be deleted.

This behavior primarily effects the first word deletion after a language switch,
most subsequent deletions are correct, except when linebreaks are reached.

Tested with 1.6/20040111 patched with this fix.

Prog.
I think the fix to bug 162242 needs some refinement to eliminate that problem.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
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

Created:
Updated:
Size: