New issue
Advanced search Search tips

Issue 618184 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 603386



Sign in to add a comment

MacViews: RTL support for views::Textfield on Mac.

Project Member Reported by karandeepb@chromium.org, Jun 8 2016

Issue description

This is a tracker bug to track RTL support for views::Textfield on Mac.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e86f927228e135784931a9eb9825cb9ec4509267

commit e86f927228e135784931a9eb9825cb9ec4509267
Author: karandeepb <karandeepb@chromium.org>
Date: Wed Jun 08 23:43:28 2016

BridgedContentView: Modify IsTextRTL to use GetFirstStrongCharacterDirection.

Currently, IsTextRTL method in BridgedContentView uses
base::i18n::GetStringDirection to get the string text direction. This is
inconsistent with RenderText::GetTextDirection. This CL modifies IsTextRTL to
use base::i18n::GetFirstStrongCharacterDirection to ensure consistency with
RenderText::GetTextDirection.

This also necessitates modifying SendHomeEvent and SendEvent in
textfield_unittest.cc, to prevent the tests TextfieldTest.HitOutsideTextAreaTest
and TextfieldTest.HitOutsideTextAreaInRTLTest from regressing on MacViews. This
is because currently, SendHomeEvent and SendEndEvent correspond to logical
direction on other platforms but visual direction on Mac.

The reason that the tests TextfieldTest.HitOutsideTextAreaTest and
TextfieldTest.HitOutsideTextAreaInRTLTest passed up-till now is that the
incorrect IsTextRTL and Send{Home/End}Event implementations cancelled each other
out. IsTextRTL depends on GetStringDirection currently, and hence it always
returned false for text of mixed directionality. A SendHomeEvent would do a
Cmd+Left which would generate a moveToLeftEndOfLine. Since IsTextRTL returned
false, a moveToLeftEndOfLine mapped to a moveToBeginningOfLine in
BridgedContentView. Hence a Send{Home/End}Event mapped to
moveTo{Beginning/End}OfLine, the two incorrect implementations cancelling each
other out.

BUG= 618184 

Review-Url: https://codereview.chromium.org/2050583002
Cr-Commit-Position: refs/heads/master@{#398736}

[modify] https://crrev.com/e86f927228e135784931a9eb9825cb9ec4509267/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/e86f927228e135784931a9eb9825cb9ec4509267/ui/views/controls/textfield/textfield_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/853189795fc2ac4170c34ff41037b0b76281f1ee

commit 853189795fc2ac4170c34ff41037b0b76281f1ee
Author: karandeepb <karandeepb@chromium.org>
Date: Tue Jun 14 06:29:18 2016

Add GetTextDirection to ui::TextInputClient API.

TextInputClient supports forcing a particular TextDirection via
ChangeTextDirectionAndLayoutAlignment, but has no method for retreiving the
same. As a result clients have no way but to recompute the text direction every
time from the text. This CL adds a GetTextDirection method to TextInputClient to
get the current text direction.

BUG= 618184 

Review-Url: https://codereview.chromium.org/2024003002
Cr-Commit-Position: refs/heads/master@{#399651}

[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/components/arc/ime/arc_ime_service.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/components/arc/ime/arc_ime_service.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/content/browser/renderer_host/render_widget_host_view_aura.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/content/browser/renderer_host/render_widget_host_view_aura.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/base/ime/dummy_text_input_client.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/base/ime/dummy_text_input_client.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/base/ime/text_input_client.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/views/controls/prefix_selector.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/views/controls/prefix_selector.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/views/controls/textfield/textfield.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/views/controls/textfield/textfield.h

Project Member

Comment 3 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/853189795fc2ac4170c34ff41037b0b76281f1ee

commit 853189795fc2ac4170c34ff41037b0b76281f1ee
Author: karandeepb <karandeepb@chromium.org>
Date: Tue Jun 14 06:29:18 2016

Add GetTextDirection to ui::TextInputClient API.

TextInputClient supports forcing a particular TextDirection via
ChangeTextDirectionAndLayoutAlignment, but has no method for retreiving the
same. As a result clients have no way but to recompute the text direction every
time from the text. This CL adds a GetTextDirection method to TextInputClient to
get the current text direction.

BUG= 618184 

Review-Url: https://codereview.chromium.org/2024003002
Cr-Commit-Position: refs/heads/master@{#399651}

[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/components/arc/ime/arc_ime_service.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/components/arc/ime/arc_ime_service.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/content/browser/renderer_host/render_widget_host_view_aura.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/content/browser/renderer_host/render_widget_host_view_aura.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/base/ime/dummy_text_input_client.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/base/ime/dummy_text_input_client.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/base/ime/text_input_client.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/views/controls/prefix_selector.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/views/controls/prefix_selector.h
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/views/controls/textfield/textfield.cc
[modify] https://crrev.com/853189795fc2ac4170c34ff41037b0b76281f1ee/ui/views/controls/textfield/textfield.h

Project Member

Comment 4 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d3d07f1e6205d7355e0b072c384dcd1a318c2c71

commit d3d07f1e6205d7355e0b072c384dcd1a318c2c71
Author: karandeepb <karandeepb@chromium.org>
Date: Wed Jun 15 06:47:29 2016

BridgedContentView: Modify IsTextRTL to use TextInputClient::GetTextDirection.

crrev.com/2024003002 introduced GetTextDirection to the TextInputClient API.
This CL modifies IsTextRTL in BridgedContentView to use the newly added
TextInputClient::GetTextDirection method, instead of recomputing the
directionality of text every time.

BUG= 618184 

Review-Url: https://codereview.chromium.org/2063413002
Cr-Commit-Position: refs/heads/master@{#399853}

[modify] https://crrev.com/d3d07f1e6205d7355e0b072c384dcd1a318c2c71/ui/views/cocoa/bridged_content_view.mm

Status: Assigned (was: Available)

Comment 6 by tapted@chromium.org, Dec 12 2016

Blocking: 603386
Labels: Phase3
Status: Fixed (was: Assigned)
Don't think there's much to do here. Marking as fixed. 

Sign in to add a comment