New issue
Advanced search Search tips

Issue 826270 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

MacViewsBrowser: Omnibox does not have a focus ring

Project Member Reported by rsesek@chromium.org, Mar 27 2018

Issue description

Chrome Version: 67.0.3381.0
OS: macOS 10.13.3

What steps will reproduce the problem?
(1) --enable-features=ViewsBrowserWindows
(2) Click-to-focus the Omnibox
(3) Observe lack of focus ring

What is the expected result?
There should be a focus ring around the Omnibox. When clicking into the Omnibox, the focus ring should appear first, and then the text should be highlighted.

What happens instead?
No focus ring appears, but the text is highlghted.

Please use labels and text to provide additional information.


For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
cocoa.mov
54.3 KB View Download
views.mov
60.3 KB View Download
Labels: Target-67
Owner: ellyjo...@chromium.org
Status: Assigned (was: Untriaged)

Comment 2 by gov...@chromium.org, Mar 27 2018

Labels: M-67
Status: Started (was: Assigned)
Fix is up: <https://chromium-review.googlesource.com/c/chromium/src/+/980679>

Comment 4 by gov...@chromium.org, Mar 29 2018

** Bulk Edit **

There are only two M67 dev releases left on 04/03 & 04/10 before M67 branch on 04/12. Please try to land the fix ASAP to trunk so we can move forward with 50%-50% experiment on M67 Canary/Dev (if possible at all). Thank you.
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 29 2018

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

commit a597da3c0b1507f260be3b311a9021bef52370df
Author: Elly Fong-Jones <ellyjones@chromium.org>
Date: Thu Mar 29 18:41:58 2018

macviews: add focus ring to omnibox

This change is somewhat complicated by the fact that the omnibox gets
focus, but the location bar (which contains it) should get the actual
ring. Therefore:

1) Add LocationBarView::OnOmnibox{Focused,Blurred} to notify the
   location bar that the omnibox gained/lost focus;
2) Have OmniboxViewViews call LocationBarView::OnOmnibox{Focused,
   Blurred} at appropriate times;
3) Add ChromePlatformStyle to hold per-platform UI differences, by
   analogy with //ui/views PlatformStyle;
4) Add ChromePlatformStyle::kOmniboxUsesFocusRing to specialize
   this behavior for Mac;
5) Export FocusRing from Views for use here;
6) Have LocationBarView install/uninstall a focus ring as needed to
   track omnibox focus state;
7) Have LocationBarView::Layout() call View::Layout(), so that the
   focus ring's layout gets updated when the LocationBarView changes
   size;
8) Stop calling SetMasksToBounds(true) in LocationBarView::Init(),
   since this prevents the focus ring from drawing outside the
   LocationBarView's bounds, which is exactly where focus rings are
   supposed to draw.

Two concerns:
It seems that (7) might cause redundant work with the rest of
LocationBarView::Layout(), since it will lay out all the subviews,
but since LocationBarView has no LayoutManager I think this is
actually more or less a no-op.
The layer masking at (8) was originally added to fix some bugs (like
 https://crbug.com/588331 ) where children of LocationBarView were
unintentionally drawing outside its bounds. I tried to reproduce these
bugs without the layer masking, and they don't show up locally, so
perhaps they were fixed elsewhere.

Bug:  826270 
Change-Id: Ic7dd287d0260cfce0f3a00680027aaa2d87fdcb1
Reviewed-on: https://chromium-review.googlesource.com/980679
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546882}
[modify] https://crrev.com/a597da3c0b1507f260be3b311a9021bef52370df/chrome/browser/ui/BUILD.gn
[add] https://crrev.com/a597da3c0b1507f260be3b311a9021bef52370df/chrome/browser/ui/views/chrome_platform_style.cc
[add] https://crrev.com/a597da3c0b1507f260be3b311a9021bef52370df/chrome/browser/ui/views/chrome_platform_style.h
[add] https://crrev.com/a597da3c0b1507f260be3b311a9021bef52370df/chrome/browser/ui/views/chrome_platform_style_mac.mm
[modify] https://crrev.com/a597da3c0b1507f260be3b311a9021bef52370df/chrome/browser/ui/views/location_bar/location_bar_view.cc
[modify] https://crrev.com/a597da3c0b1507f260be3b311a9021bef52370df/chrome/browser/ui/views/location_bar/location_bar_view.h
[modify] https://crrev.com/a597da3c0b1507f260be3b311a9021bef52370df/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
[modify] https://crrev.com/a597da3c0b1507f260be3b311a9021bef52370df/ui/views/controls/focus_ring.h

Status: Fixed (was: Started)
Labels: TE-Verified-M67 TE-Verified-67.0.3384.0
Verified the fix on Mac 10.13.1 using Chrome version #67.0.3384.0 as per the comment #0.
Attaching screen cast for reference.
Observed focus ring around the Omnibox.
Hence, the fix is working as expected. 
Adding the verified labels.
Note: Able to reproduce the issue on reported chrome version 67.0.3381.0.

Thanks...!!
826270 CL Verif.mp4
5.5 MB View Download

Sign in to add a comment