Bug 3729 - right/left arrow keys move forward/backward through document instead of right/left in RTL text
Summary: right/left arrow keys move forward/backward through document instead of right...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 412
Hardware: Macintosh OS X 10.4
: P1 Major
Assignee: mitz
URL:
Keywords: InRadar, Regression
: 20612 (view as bug list)
Depends on: 3710
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-26 17:13 PDT by Darin Adler
Modified: 2009-01-07 11:21 PST (History)
5 users (show)

See Also:


Attachments
unfinished patch (23.02 KB, patch)
2006-09-26 13:06 PDT, Justin Garcia
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2005-06-26 17:13:49 PDT
Also in Radar as:

    <rdar://problem/4036353> RTL: arrow keys move insertion bar backwards in RTL text

Easy to reproduce by typing in some Hebrew text, and then using the arrow keys. You'll move forward/
back through the document rather than left/right through the visible text.
Comment 1 Darin Adler 2005-06-26 17:14:50 PDT
My patch in bug 3710 has some relevant related changes, so it might be good to fix that bug first.
Comment 2 mitz 2006-03-30 12:44:37 PST
Raising to P1 since this causes a regression with the new text fields.
Comment 3 Maciej Stachowiak 2006-04-02 23:25:34 PDT
These are all text field regressions so they should all be P1.
Comment 4 mitz 2006-07-29 08:08:46 PDT
Here's one of the relatively simple cases that I just don't know how to solve (uppercase letters are RTL):

<div style="direction:ltr">
abcABC<span>DEF</span>
</div>

It is laid out as

abcFEDCBA

The primary caret positions, from left to right, should be:
div.text[0] div.text[1] div.text[2] div.text[3] span.text[2] span.text[1] span.text[0] div.text[5] div.text[4] span.text[3]

That last step, from div.text[4] to span.text[3] is the tricky one, and so is recognizing that span.text[3] is a rightmost position.

There is also a variant where there is another text node after the span, but that text node wraps to the next line.
Comment 5 Justin Garcia 2006-09-26 13:06:57 PDT
Created attachment 10786 [details]
unfinished patch

Here's an unfinished patch written a while back by an Apple Engineer.
Comment 6 mitz 2008-04-27 21:51:00 PDT
Fixed in <http://trac.webkit.org/changeset/32605>.
Comment 7 mitz 2009-01-07 11:21:53 PST
*** Bug 20612 has been marked as a duplicate of this bug. ***