New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 669321 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

elm: When closing window, bookmark bar [disappears/turns black] first, which is a little distracting

Project Member Reported by djkurtz@chromium.org, Nov 29 2016

Issue description

Chrome Version       : 55.0.2883.54
OS Version: 8872.54.0
URLs (if applicable) :

What steps will reproduce the problem?
1. Open Window (Ctrl-N)
2. Show Bookmark Bar (Ctrl+Shift+B)
3. Close Window (Ctrl-W)

What is the expected result?

Entire window animates and closee. 

What happens instead of that?

Bookmark bar disappears, then window animates and closes. 

Please provide any additional information below. Attach a screenshot if
possible.

UserAgentString: Mozilla/5.0 (X11; CrOS aarch64 8872.54.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.54 Safari/537.36



 
window_close_no_bookmark_bar.webm
1.2 MB View Download
Components: -Internals>Cast>UI -UI>Shell>WindowManager
Owner: ----
Status: Untriaged (was: Assigned)
Happens on other devices as well.  This is really something the chrome bookmarks team should pick up.

Comment 2 by ketakid@google.com, Jan 31 2017

Owner: abodenha@chromium.org
Status: Assigned (was: Untriaged)
That's not an issue in bookmark. This is because either the detached layer lost texture, or not suppressing reaping during hide animation. I can help diagnose the issue if you can find a owner.
Owner: afakhry@chromium.org
Cc: afakhry@chromium.org
Owner: weidongg@chromium.org
weidongg, can you please take a look?
I could repro this. I investigated, but not sure where to start to look into.

@oshima, in#3 you mentioned lost texture and not suppressing reaping, could you please give some explanations? or which files have the related code that I can learn these things?

Comment 7 by osh...@chromium.org, Jun 16 2017

When a browser window is closed, we copy all layers before closing the window and apply animation to it.

https://cs.chromium.org/chromium/src/ui/wm/core/window_animations.h?rcl=040abfad9f3d323bfb5d94726188568a7cc3282a&l=82
https://cs.chromium.org/chromium/src/ui/wm/core/window_util.h?rcl=040abfad9f3d323bfb5d94726188568a7cc3282a&l=48

BookmarkBarView paint the content to its own layer.
https://cs.chromium.org/chromium/src/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc?rcl=040abfad9f3d323bfb5d94726188568a7cc3282a&l=611

here are a couple of possibilities that I can think of:

1) the texture for the bookmark bar is gone (it's somehow marked as damaged?)
2) the layer for the bookmarkbar wasn't copied for closing animation.
 (may be deleted or hidden early before close animation starts?)
3) the layer for the bookmark bar gets recreated twice during shutdown.
 The second recreate will copy the newly created layer, so it'd be empty.

I would check the layer hierarchy first and understand the structure. Note that
these are just my guess and there is a chance that this is something else.

Let me know if you need more help.
@oshima, thanks a lot for the explanation. I seems to find the reason, though I am not sure whether it's the root reason.
If the bookmark is detached, the bookmark view's parent is set to browser view. Otherwise, the parent is set to top level container. So I make the parent always set to browser view (replace 'new_parent' with 'this' in [1] and clean up code) and the problem is solved.

[1] https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_view.cc?l=2203

Comment 9 by osh...@chromium.org, Jun 19 2017

Maybe new_parent is set to nullptr during shutdown?
I just checked, Yes, you are right. So maybe the right fix is to leave bookmark view's parent unchanged if new_parent is null? 
I think the bookmark still needs to be "hidden" if a user explicitly requested to hide it. I believe you can check it using feature, so you should skip hiding only if feature isn't disabled?
I uploaded a CL https://codereview.chromium.org/2946813002/ using the solution in #11.

There's one thing I am not sure. When I use Ctrl+Shift+B to make bookmark transition from show state to hidden state, the parent of bookmark is still the top level container [1]. The program will not go to [2] to remove bookmark from parent view.

Maybe I should set parent view to top level container in [1] only if bookmark is in show state?

[1] https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_view.cc?type=cs&l=2200
[2] https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_view.cc?type=cs&l=2243
Cc: pkasting@chromium.org
+pkasting@ who may know how bookmark bar visibility is controlled.
Some background:

* The top container is hidden during fullscreen, and infobars are placed below it.  So when considering whether the bookmark bar should be in that container, consider how it should behave w.r.t. those two items.  This should explain why the detached and attached bars are different.

* Changing whether the bookmark bar snaps between parents at the start versus end of the detach animation -- which is what I perceive comment 12 to be proposing -- will affect when the bookmark bar "snaps above/below" a visible infobar during the animation.  Changing this will almost certainly look bad.  If you seriously want to test this, change the code so you always get an infobar and the bookmark bar animation runs at about 1/20th speed, and play with it.
Re #14, thanks for the background. I still have one question about the comment here https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_view.cc?type=cs&l=2239, "Bookmark bar is being detached from all views because it is hidden." It seems to be confusing.
Ctrl+shift+B triggers the bookmark bar to transition state:
SHOW<->HIDDEN, SHOW<->DETACHED. In DETACHED state, parent is browser view. In both SHOW and HIDDEN state, parent is top level container. This seems to be contradictory to the comment?

Project Member

Comment 16 by bugdroid1@chromium.org, Jun 26 2017

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

commit b5cae6d3aaf71d0f6186504da2f50fef77d20982
Author: weidongg <weidongg@chromium.org>
Date: Mon Jun 26 21:51:52 2017

Bookmark disappear first when closing browser

The CL prevents the bookmark from disappearing ahead of browser by
avoiding bookmark's parent being set to nullptr at browser shutdown
when web contents are null.

BUG= 669321 

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

[modify] https://crrev.com/b5cae6d3aaf71d0f6186504da2f50fef77d20982/chrome/browser/ui/views/frame/browser_view.cc
[modify] https://crrev.com/b5cae6d3aaf71d0f6186504da2f50fef77d20982/chrome/browser/ui/views/frame/browser_view_unittest.cc

Status: Fixed (was: Assigned)
Project Member

Comment 18 by bugdroid1@chromium.org, Aug 9 2017

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

commit 6839ed727ec08716d3ebf471d9feae1d9f36a599
Author: Weidong Guo <weidongg@chromium.org>
Date: Wed Aug 09 06:00:43 2017

Fix a crash report-BookmarkBarView::ButtonPressed

https://codereview.chromium.org/2946813002 fixed void area of bookmark
bar by preventing its parent view being set to nullptr. This may cause
the crash when bookmark bar is clicked when closing browser.
This CL uses another way to fix the issue while not causing the crash.
It modifies BrowserView::IsBookmarkBarVisible() to return false when
bookmark's parent is nullptr. So bookmark bar is set to invisible and
its height is set to 0 in BrowserViewLayout when closing the browser.

BUG=744211, 669321 
TEST=BrowserViewTest.BookmarkBarInvisibleOnShutdown

Change-Id: I277aa2215ccbab29e49bcc27f5235ed42bf1c3ca
Reviewed-on: https://chromium-review.googlesource.com/607033
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492843}
[modify] https://crrev.com/6839ed727ec08716d3ebf471d9feae1d9f36a599/chrome/browser/ui/views/frame/browser_view.cc
[modify] https://crrev.com/6839ed727ec08716d3ebf471d9feae1d9f36a599/chrome/browser/ui/views/frame/browser_view_unittest.cc

Project Member

Comment 19 by bugdroid1@chromium.org, Aug 14 2017

Labels: merge-merged-3163
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d71d09c135dd76048429cdb5d99c342318307cf8

commit d71d09c135dd76048429cdb5d99c342318307cf8
Author: Ahmed Fakhry <afakhry@google.com>
Date: Mon Aug 14 18:51:40 2017

[Merge to M61] Fix a crash report-BookmarkBarView::ButtonPressed

https://codereview.chromium.org/2946813002 fixed void area of bookmark
bar by preventing its parent view being set to nullptr. This may cause
the crash when bookmark bar is clicked when closing browser.
This CL uses another way to fix the issue while not causing the crash.
It modifies BrowserView::IsBookmarkBarVisible() to return false when
bookmark's parent is nullptr. So bookmark bar is set to invisible and
its height is set to 0 in BrowserViewLayout when closing the browser.

TBR=weidongg@chromium.org,sky@chromium.org
BUG=744211, 669321 
TEST=BrowserViewTest.BookmarkBarInvisibleOnShutdown

(cherry picked from commit 6839ed727ec08716d3ebf471d9feae1d9f36a599)

Change-Id: I277aa2215ccbab29e49bcc27f5235ed42bf1c3ca
Reviewed-on: https://chromium-review.googlesource.com/607033
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#492843}
Reviewed-on: https://chromium-review.googlesource.com/614142
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/branch-heads/3163@{#545}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
[modify] https://crrev.com/d71d09c135dd76048429cdb5d99c342318307cf8/chrome/browser/ui/views/frame/browser_view.cc
[modify] https://crrev.com/d71d09c135dd76048429cdb5d99c342318307cf8/chrome/browser/ui/views/frame/browser_view_unittest.cc

Comment 20 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment