Open Bug 350073 Opened 20 years ago Updated 4 years ago

Bidi: Word deletion happens immediately even if the caret is not adjacent to the deleted word

Categories

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

defect

Tracking

()

People

(Reporter: uriber, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(1 file)

In bidi text, when backspace is pressed, and the caret is not next to the character logically before the insertion point (i.e., the character to be deleted), then no deletion happens, but the caret moves visually to the position after the character to be deleted. The same is true for "del". This is done in order not to unexpectedly delete a character which the user did not mean to delete. However, when instead of "backspace" and "del", ctrl+backspace or ctrl+del is used to delete a whole word, the word is deleted immediately. Instead, the caret should be moved as in the "delete character" cases, and no deletion should happen. Testcase coming up
Attached file testcase —
With the included instructions, this testcase should work for either setting of layout.word_select.eat_space_to_next_word.
Just a note on WIP here: I had hoped that this would be as simple as moving http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/editor/libeditor/text/nsTextEditRules.cpp&rev=1.204&mark=916-919#903 outside the |if (bCollapsed) {}| (and the equivalent in nsHTMLEditRules.cpp) but there are problems: CheckBidiLevelForDeletion() finds the direction of the deletion by testing (nsIEditor::eNext==aAction), but for word deletion aAction is set to nsIEditor::eNone in nsPlainTextEditor::DeleteSelection()
Depends on: 350564
Blocks: 419406
Another problem is that extending the selection affects the caret bidi level (nsFrameSelection::MoveCaret() calls SetCaretBidiLevel()) - and this throws off the tests in CheckBidiLevelForDeletion().
No longer blocks: 419406
Depends on: 419406
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: layout.bidi → layout.fonts-and-text
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: