Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Issue 2050583002: BridgedContentView: Modify IsTextRTL to use GetFirstStrongCharacterDirection. (Closed)

Created:
4 years, 6 months ago by karandeepb
Modified:
4 years, 6 months ago
Reviewers:
tapted, msw
CC:
chromium-reviews, tfarina, James Su, shuchen+watch_chromium.org, yusukes+watch_chromium.org, nona+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/e86f927228e135784931a9eb9825cb9ec4509267 Cr-Commit-Position: refs/heads/master@{#398736}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -7 lines) Patch
M ui/views/cocoa/bridged_content_view.mm View 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/controls/textfield/textfield_unittest.cc View 1 1 chunk +10 lines, -6 lines 0 comments Download

Messages

Total messages: 22 (11 generated)
karandeepb
PTAL Trent. Thanks.
4 years, 6 months ago (2016-06-08 02:55:33 UTC) #4
tapted
Can you add a bug to track? It can just be "RTL support for views::Textfield ...
4 years, 6 months ago (2016-06-08 04:16:45 UTC) #5
karandeepb
>>Can you add a bug to track? It can just be "RTL support for views::Textfield ...
4 years, 6 months ago (2016-06-08 04:56:05 UTC) #7
tapted
On 2016/06/08 04:56:05, karandeepb wrote: > >>Can you add a bug to track? It can ...
4 years, 6 months ago (2016-06-08 05:59:04 UTC) #8
karandeepb
PTAL Trent. Thanks. https://codereview.chromium.org/2050583002/diff/1/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/2050583002/diff/1/ui/views/controls/textfield/textfield_unittest.cc#newcode521 ui/views/controls/textfield/textfield_unittest.cc:521: // Move to beginning of line ...
4 years, 6 months ago (2016-06-08 08:04:56 UTC) #12
tapted
lgtm - thanks!
4 years, 6 months ago (2016-06-08 08:16:10 UTC) #13
karandeepb
PTAL msw@ for ui/views/controls/textfield/textfield_unittest.cc review.
4 years, 6 months ago (2016-06-08 08:18:44 UTC) #15
msw
lgtm
4 years, 6 months ago (2016-06-08 20:05:23 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2050583002/20001
4 years, 6 months ago (2016-06-08 22:59:06 UTC) #18
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 6 months ago (2016-06-08 23:43:46 UTC) #20
commit-bot: I haz the power
4 years, 6 months ago (2016-06-08 23:44:57 UTC) #22
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/e86f927228e135784931a9eb9825cb9ec4509267
Cr-Commit-Position: refs/heads/master@{#398736}

Powered by Google App Engine
This is Rietveld 408576698