|
|
Chromium Code Reviews|
Created:
4 years, 4 months ago by Matt Giuca Modified:
4 years, 4 months ago Reviewers:
Ted C CC:
chromium-reviews, 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. |
DescriptionAndroid Omnibox: Do not force LTR text direction when empty.
Fixes a regression introduced in r400359: the "Search or type URL"
placeholder text jumping back and forth from left and right alignment
when in RTL languages.
Also fixes incorrect text direction when restoring a closed tab.
BUG=631422
TEST=On a phone-sized Android device, with language set to
Hebrew/Arabic, in landscape, open New Tab Page and scroll page up and
down. Should see the grey placeholder text in Omnibox always
right-aligned, not jumping from left to right.
Committed: https://crrev.com/1d266aa00775a9e9307c7d342fb6354ba7707012
Cr-Commit-Position: refs/heads/master@{#410510}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Also fix up the text direction when text changes. #Messages
Total messages: 20 (13 generated)
The CQ bit was checked by mgiuca@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Android Omnibox: Do not force LTR text direction when empty. Fixes the "Search or type URL" placeholder text jumping back and forth from left and right alignment when in RTL languages. BUG=631422 TEST=On a phone-sized Android device, with language set to Hebrew/Arabic, in landscape, open New Tab Page and scroll page up and down. Should see the grey placeholder text in Omnibox always right-aligned, not jumping from left to right. ========== to ========== Android Omnibox: Do not force LTR text direction when empty. Fixes a regression introduced in r400359: the "Search or type URL" placeholder text jumping back and forth from left and right alignment when in RTL languages. BUG=631422 TEST=On a phone-sized Android device, with language set to Hebrew/Arabic, in landscape, open New Tab Page and scroll page up and down. Should see the grey placeholder text in Omnibox always right-aligned, not jumping from left to right. ==========
mgiuca@chromium.org changed reviewers: + tedchoc@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2182183008/diff/1/chrome/android/java/src/org... File chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java (right): https://codereview.chromium.org/2182183008/diff/1/chrome/android/java/src/org... chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java:449: if (focused || length() == 0) { If you aren't on the NTP (i.e. there is a URL), you focus the omnibox and then clear the text. Then you defocus the omnibox w/o hitting enter, do we hit this check before we revert the text back to the URL? I'm wondering if we also need to hook into text changed to see if the text changes and set it to LTR. Or what happens if you're on the NTP and we set this as INHERIT on defocus, then you click on a most visited item. Wouldn't it still be in inherit until you cycle the omnibox focus?
Description was changed from ========== Android Omnibox: Do not force LTR text direction when empty. Fixes a regression introduced in r400359: the "Search or type URL" placeholder text jumping back and forth from left and right alignment when in RTL languages. BUG=631422 TEST=On a phone-sized Android device, with language set to Hebrew/Arabic, in landscape, open New Tab Page and scroll page up and down. Should see the grey placeholder text in Omnibox always right-aligned, not jumping from left to right. ========== to ========== Android Omnibox: Do not force LTR text direction when empty. Fixes a regression introduced in r400359: the "Search or type URL" placeholder text jumping back and forth from left and right alignment when in RTL languages. Also fixes incorrect text direction when restoring a closed tab. BUG=631422 TEST=On a phone-sized Android device, with language set to Hebrew/Arabic, in landscape, open New Tab Page and scroll page up and down. Should see the grey placeholder text in Omnibox always right-aligned, not jumping from left to right. ==========
https://codereview.chromium.org/2182183008/diff/1/chrome/android/java/src/org... File chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java (right): https://codereview.chromium.org/2182183008/diff/1/chrome/android/java/src/org... chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java:449: if (focused || length() == 0) { On 2016/08/05 20:25:05, Ted C wrote: > If you aren't on the NTP (i.e. there is a URL), you focus the omnibox and then > clear the text. Then you defocus the omnibox w/o hitting enter, do we hit this > check before we revert the text back to the URL? > > I'm wondering if we also need to hook into text changed to see if the text > changes and set it to LTR. > > Or what happens if you're on the NTP and we set this as INHERIT on defocus, then > you click on a most visited item. Wouldn't it still be in inherit until you > cycle the omnibox focus? Right, good thinking. Basically those two issues arise because the text can change without focus changing. I just found another one which is when you launch Chrome and it restores tabs, the tab's URL bar is never focused so this was not being called. I moved it into a separate method and called it from setText. Now the alignment is set correctly in all of these cases. Thanks for the catch!
The CQ bit was checked by mgiuca@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/08/08 05:24:18, Matt Giuca wrote: > https://codereview.chromium.org/2182183008/diff/1/chrome/android/java/src/org... > File chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java > (right): > > https://codereview.chromium.org/2182183008/diff/1/chrome/android/java/src/org... > chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java:449: if > (focused || length() == 0) { > On 2016/08/05 20:25:05, Ted C wrote: > > If you aren't on the NTP (i.e. there is a URL), you focus the omnibox and then > > clear the text. Then you defocus the omnibox w/o hitting enter, do we hit > this > > check before we revert the text back to the URL? > > > > I'm wondering if we also need to hook into text changed to see if the text > > changes and set it to LTR. > > > > Or what happens if you're on the NTP and we set this as INHERIT on defocus, > then > > you click on a most visited item. Wouldn't it still be in inherit until you > > cycle the omnibox focus? > > Right, good thinking. Basically those two issues arise because the text can > change without focus changing. I just found another one which is when you launch > Chrome and it restores tabs, the tab's URL bar is never focused so this was not > being called. > > I moved it into a separate method and called it from setText. Now the alignment > is set correctly in all of these cases. Thanks for the catch! lgtm
The CQ bit was checked by mgiuca@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Android Omnibox: Do not force LTR text direction when empty. Fixes a regression introduced in r400359: the "Search or type URL" placeholder text jumping back and forth from left and right alignment when in RTL languages. Also fixes incorrect text direction when restoring a closed tab. BUG=631422 TEST=On a phone-sized Android device, with language set to Hebrew/Arabic, in landscape, open New Tab Page and scroll page up and down. Should see the grey placeholder text in Omnibox always right-aligned, not jumping from left to right. ========== to ========== Android Omnibox: Do not force LTR text direction when empty. Fixes a regression introduced in r400359: the "Search or type URL" placeholder text jumping back and forth from left and right alignment when in RTL languages. Also fixes incorrect text direction when restoring a closed tab. BUG=631422 TEST=On a phone-sized Android device, with language set to Hebrew/Arabic, in landscape, open New Tab Page and scroll page up and down. Should see the grey placeholder text in Omnibox always right-aligned, not jumping from left to right. Committed: https://crrev.com/1d266aa00775a9e9307c7d342fb6354ba7707012 Cr-Commit-Position: refs/heads/master@{#410510} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/1d266aa00775a9e9307c7d342fb6354ba7707012 Cr-Commit-Position: refs/heads/master@{#410510} |
