Bug 64626 - An arrow key collapses directionless selection range in the wrong direction in BiDi
Summary: An arrow key collapses directionless selection range in the wrong direction i...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on: 66431
Blocks: 57340
  Show dependency treegraph
 
Reported: 2011-07-15 14:13 PDT by Ryosuke Niwa
Modified: 2011-08-18 02:45 PDT (History)
10 users (show)

See Also:


Attachments
fixes the bug (9.12 KB, patch)
2011-07-15 17:17 PDT, Ryosuke Niwa
darin: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-07-15 14:13:14 PDT
When a selection range is collapsed by an arrow key, the the caret appears on the wrong direction if the text's direction is different from that of block.

e.g. if we had RTL text CBA in a LTR block, and B was selected, pressing left-arrow key collapses the selection on the right of B.
Comment 1 Xiaomei Ji 2011-07-15 15:12:48 PDT
currently, when pressing left arrow, webkit collapses the selection to the logical beginning in LTR context, and collapse the selection to the logical end in RTL context.

Amnon, Jeremy, and Aharon all agree that: collapsing the selection in the visual direction is what is expected to happen.
Comment 2 Ryosuke Niwa 2011-07-15 17:17:45 PDT
Created attachment 101075 [details]
fixes the bug
Comment 3 WebKit Review Bot 2011-07-15 18:17:42 PDT
Comment on attachment 101075 [details]
fixes the bug

Attachment 101075 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9092544

New failing tests:
editing/selection/collapse-selection-in-bidi.html
Comment 4 Ryosuke Niwa 2011-07-28 19:38:53 PDT
Ping reviewers
Comment 5 Ryosuke Niwa 2011-08-16 16:07:19 PDT
Ping reviewers.
Comment 6 Darin Adler 2011-08-17 09:40:59 PDT
Comment on attachment 101075 [details]
fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=101075&action=review

Seems fine.

> Source/WebCore/editing/FrameSelection.cpp:379
> +    int offset = 0;

Seems non-helpful to initialize this to 0.
Comment 7 Ryosuke Niwa 2011-08-17 11:07:38 PDT
Committed r93221: <http://trac.webkit.org/changeset/93221>