Bug 64626

Summary: An arrow key collapses directionless selection range in the wrong direction in BiDi
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, dglazkov, enrica, eric, hyatt, leviw, mitz, playmobil, webkit.review.bot, xji
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 66431    
Bug Blocks: 57340    
Attachments:
Description Flags
fixes the bug darin: review+, webkit.review.bot: commit-queue-

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>