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

Issue 2813353002: Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. (Closed)

Created:
3 years, 8 months ago by ananta
Modified:
3 years, 8 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. The proposed fix is to notify the parent views when a child enables layering. The parent in this case the ScrollView overrides the newly added notification OnChildLayerChanged() and enables viewport layering. This ensures that the ring gets clipped. Longer term it seems like the focus ring should really be a property of the view and should not be instantiated by different controls all over the place. That for a later patchset. BUG=665412, 656198 TEST=Covered by test ViewObserverTest.ScrollViewChildAddLayerTest and ViewObserverTest.ChildViewLayerNotificationTest Review-Url: https://codereview.chromium.org/2813353002 Cr-Commit-Position: refs/heads/master@{#465720} Committed: https://chromium.googlesource.com/chromium/src/+/5c05d7143480feda606f6425f78f3b18598f9310

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix compile failures #

Patch Set 3 : Rename layer notification to OnChildLayerChanged() #

Total comments: 12

Patch Set 4 : Address review comments and add test #

Patch Set 5 : Remove newline and global variable #

Total comments: 22

Patch Set 6 : Address review comments and add new test which validates we don't receive two layer change notifica… #

Patch Set 7 : Remove the contents_viewport() accessor #

Patch Set 8 : Fix test #

Total comments: 12

Patch Set 9 : Next round of review comments #

Patch Set 10 : Move the View::NotifyParentsOfLayerChange() function to the accelerated functions block #

Patch Set 11 : Fix compile failures #

Total comments: 4

Patch Set 12 : Address review comments #

Total comments: 2

Patch Set 13 : \ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+498 lines, -319 lines) Patch
M ui/views/controls/scroll_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +299 lines, -282 lines 0 comments Download
M ui/views/controls/scroll_view.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +46 lines, -6 lines 0 comments Download
M ui/views/view.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +26 lines, -3 lines 0 comments Download
M ui/views/view.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +50 lines, -28 lines 0 comments Download
M ui/views/view_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +77 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 42 (27 generated)
ananta
https://codereview.chromium.org/2813353002/diff/1/ui/views/controls/focus_ring.cc File ui/views/controls/focus_ring.cc (left): https://codereview.chromium.org/2813353002/diff/1/ui/views/controls/focus_ring.cc#oldcode90 ui/views/controls/focus_ring.cc:90: SetPaintToLayer(); Moved this code to FocusRing::Install() as we need ...
3 years, 8 months ago (2017-04-12 23:54:04 UTC) #3
sky
Also, please add test coverage. https://codereview.chromium.org/2813353002/diff/40001/ui/views/controls/focus_ring.cc File ui/views/controls/focus_ring.cc (right): https://codereview.chromium.org/2813353002/diff/40001/ui/views/controls/focus_ring.cc#newcode43 ui/views/controls/focus_ring.cc:43: // A layer is ...
3 years, 8 months ago (2017-04-17 15:24:01 UTC) #8
ananta
https://codereview.chromium.org/2813353002/diff/40001/ui/views/controls/scroll_view.cc File ui/views/controls/scroll_view.cc (right): https://codereview.chromium.org/2813353002/diff/40001/ui/views/controls/scroll_view.cc#newcode76 ui/views/controls/scroll_view.cc:76: g_scroll_with_layers_enabled && viewport->layer() != nullptr; On 2017/04/17 15:24:01, sky ...
3 years, 8 months ago (2017-04-18 03:04:26 UTC) #10
ananta
https://codereview.chromium.org/2813353002/diff/40001/ui/views/controls/focus_ring.cc File ui/views/controls/focus_ring.cc (right): https://codereview.chromium.org/2813353002/diff/40001/ui/views/controls/focus_ring.cc#newcode43 ui/views/controls/focus_ring.cc:43: // A layer is necessary to paint beyond the ...
3 years, 8 months ago (2017-04-18 03:04:56 UTC) #11
sky
https://codereview.chromium.org/2813353002/diff/80001/ui/views/controls/scroll_view.cc File ui/views/controls/scroll_view.cc (right): https://codereview.chromium.org/2813353002/diff/80001/ui/views/controls/scroll_view.cc#newcode540 ui/views/controls/scroll_view.cc:540: if (details.is_add) This should be: details.is_add && Contains(details.new_parent) And ...
3 years, 8 months ago (2017-04-18 15:35:48 UTC) #16
ananta
https://codereview.chromium.org/2813353002/diff/80001/ui/views/controls/scroll_view.cc File ui/views/controls/scroll_view.cc (right): https://codereview.chromium.org/2813353002/diff/80001/ui/views/controls/scroll_view.cc#newcode540 ui/views/controls/scroll_view.cc:540: if (details.is_add) On 2017/04/18 15:35:47, sky wrote: > This ...
3 years, 8 months ago (2017-04-18 22:22:39 UTC) #17
sky
https://codereview.chromium.org/2813353002/diff/140001/ui/views/view.h File ui/views/view.h (right): https://codereview.chromium.org/2813353002/diff/140001/ui/views/view.h#newcode343 ui/views/view.h:343: enum LayerChangeNotifyBehavior { enum class https://codereview.chromium.org/2813353002/diff/140001/ui/views/view.h#newcode359 ui/views/view.h:359: void DestroyLayerImpl(LayerChangeNotifyBehavior ...
3 years, 8 months ago (2017-04-18 23:02:21 UTC) #22
ananta
https://codereview.chromium.org/2813353002/diff/140001/ui/views/view.h File ui/views/view.h (right): https://codereview.chromium.org/2813353002/diff/140001/ui/views/view.h#newcode343 ui/views/view.h:343: enum LayerChangeNotifyBehavior { On 2017/04/18 23:02:21, sky wrote: > ...
3 years, 8 months ago (2017-04-18 23:14:47 UTC) #23
sky
https://codereview.chromium.org/2813353002/diff/80001/ui/views/controls/scroll_view.h File ui/views/controls/scroll_view.h (right): https://codereview.chromium.org/2813353002/diff/80001/ui/views/controls/scroll_view.h#newcode221 ui/views/controls/scroll_view.h:221: bool scroll_with_layers_enabled_ = false; On 2017/04/18 22:22:39, ananta wrote: ...
3 years, 8 months ago (2017-04-19 00:03:05 UTC) #26
ananta
https://codereview.chromium.org/2813353002/diff/80001/ui/views/controls/scroll_view.h File ui/views/controls/scroll_view.h (right): https://codereview.chromium.org/2813353002/diff/80001/ui/views/controls/scroll_view.h#newcode221 ui/views/controls/scroll_view.h:221: bool scroll_with_layers_enabled_ = false; On 2017/04/19 00:03:04, sky wrote: ...
3 years, 8 months ago (2017-04-19 00:53:17 UTC) #29
sky
LGTM https://codereview.chromium.org/2813353002/diff/220001/ui/views/controls/scroll_view.h File ui/views/controls/scroll_view.h (right): https://codereview.chromium.org/2813353002/diff/220001/ui/views/controls/scroll_view.h#newcode222 ui/views/controls/scroll_view.h:222: const bool scroll_with_layers_enabled_ = false; Remove the = ...
3 years, 8 months ago (2017-04-19 15:03:56 UTC) #34
ananta
https://codereview.chromium.org/2813353002/diff/220001/ui/views/controls/scroll_view.h File ui/views/controls/scroll_view.h (right): https://codereview.chromium.org/2813353002/diff/220001/ui/views/controls/scroll_view.h#newcode222 ui/views/controls/scroll_view.h:222: const bool scroll_with_layers_enabled_ = false; On 2017/04/19 15:03:56, sky ...
3 years, 8 months ago (2017-04-19 19:04:19 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2813353002/230001
3 years, 8 months ago (2017-04-19 19:05:11 UTC) #38
commit-bot: I haz the power
Committed patchset #13 (id:230001) as https://chromium.googlesource.com/chromium/src/+/5c05d7143480feda606f6425f78f3b18598f9310
3 years, 8 months ago (2017-04-19 20:00:52 UTC) #41
timbrown_
3 years, 7 months ago (2017-05-17 22:34:13 UTC) #42
Message was sent while issue was closed.
A revert of this CL (patchset #13 id:230001) has been created in
https://codereview.chromium.org/2883273007/ by timbrown@google.com.

The reason for reverting is: Causes a UI regression on Linux where the overflow
extension icons in the settings menu always render with a white background.

See http://crbug.com/722965.

Powered by Google App Engine
This is Rietveld 408576698