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

Issue 695577 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Sep 13
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Task

Blocked on:
issue 667698
issue 706931
issue 712035
issue 723002



Sign in to add a comment

Tracking bug for enabling Auto Layout on Mac

Project Member Reported by sdy@chromium.org, Feb 23 2017

Issue description

-
 

Comment 1 by sdy@chromium.org, Mar 7 2017

Blocking: 605219

Comment 2 by sdy@chromium.org, Mar 7 2017

Status: Started (was: Assigned)

Comment 3 by sdy@chromium.org, Mar 7 2017

Blockedon: 667698
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 15 2017

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

commit d06b1c5641ca1022fd4165ea46d8295fb5a215b4
Author: sdy <sdy@chromium.org>
Date: Wed Mar 15 11:32:41 2017

[Mac] Lay out the browser window when adding the download shelf.

## Summary
This fixes a regression when a browser window uses Auto Layout: if the download
shelf is added to the window without ever being shown (e.g. when installing an
extension), then the window can't be made as narrow as usual.

## Explanation
Before this CL, BrowserWindowController doesn't lay out the window after adding
the download shelf. When the download shelf is shown, -layoutSubviews is called
via -resizeView:newHeight:, but in some cases, like a quick extension install,
it's added and left hidden. In that case, the shelf will be positioned like
this (but you can't see it, since it's hidden and has zero height):

    /---------------------------------------\
    |---------------------------------------|
    |                                       |
    |                                       |
    |                                       |
    |                                       |
    |                                       |
    |                                       |
    |                                       |
    |---------------------------            |
    |                         x|            |
    \---------------------------------------/

The shelf's autoresizing mask has a flexible width but fixed margins. If the
window is wider than the shelf when it's added, then it will have a right
margin. As the user makes the window narrower, the download shelf is made
narrower and eventually reaches a minimum size.

If the user makes the window even smaller, one of two things will happen
depending on whether Auto Layout is handling the window:

- No Auto Layout: the layout breaks (but the user never sees it happen, because
  -layoutSubviews fixes it up if the download shelf is shown).

- Auto Layout: The layout engine treats the fixed margin as a constraint and
  prevents the window from becoming any narrower.

The next time -[BrowserWindowController layoutSubviews] runs, the download
shelf is made the same width as the window, and the problem goes away because
it no longer has a margin.

## Future work
Only add the download shelf to the view hierarchy when it's visible.

BUG= 667698 ,  695577 

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

[modify] https://crrev.com/d06b1c5641ca1022fd4165ea46d8295fb5a215b4/chrome/browser/ui/cocoa/browser_window_controller.h
[modify] https://crrev.com/d06b1c5641ca1022fd4165ea46d8295fb5a215b4/chrome/browser/ui/cocoa/browser_window_controller.mm
[modify] https://crrev.com/d06b1c5641ca1022fd4165ea46d8295fb5a215b4/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm

Comment 5 by sdy@chromium.org, Mar 16 2017

Cc: shrike@chromium.org

Comment 6 by sdy@chromium.org, Mar 17 2017

Blockedon: -655112

Comment 7 by sdy@chromium.org, Mar 17 2017

Blocking: 589943
Project Member

Comment 8 by bugdroid1@chromium.org, Mar 23 2017

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

commit 4f561865ff1add5ad5367d3c15f98a8fba1dff2a
Author: sdy <sdy@chromium.org>
Date: Thu Mar 23 00:14:07 2017

[Mac] Turn on Auto Layout for browser windows.

Some newer AppKit features like NSWindowStyleMaskFullSizeContentView and
NSStackView use Auto Layout, which opts the whole NSWindow into Auto Layout.

This change makes browser windows use Auto Layout but doesn't create any
dependence on it, so that it has time to bake while being easy to disable.

BUG= 695577 

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

[modify] https://crrev.com/4f561865ff1add5ad5367d3c15f98a8fba1dff2a/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm
[modify] https://crrev.com/4f561865ff1add5ad5367d3c15f98a8fba1dff2a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm

Comment 9 by shrike@chromium.org, Mar 23 2017

Cc: linds...@chromium.org
lindsayw@ - just FYI. In the past autolayout has led to strange behavior such as the window being unable to resize. We want to be on the lookout for this kind of thing, as well as any weirdness with the position of controls in the browser window.

Comment 10 by sdy@chromium.org, Mar 23 2017

Labels: -Type-Bug Type-Task
Status: Fixed (was: Started)
Thanks for remembering! This is in today's Canary (59.0.3049.0), fwiw.
Thanks, Shrike@! I'll see how this can be better incorporated into the basic acceptance testing test coverage.

Comment 12 by sdy@chromium.org, Apr 10 2017

Blockedon: 706931
Labels: -Pri-2 -M-59 Pri-3
Status: Started (was: Fixed)
Auto layout is back off due to a performance regression.

Comment 14 by sdy@chromium.org, May 10 2017

Blockedon: 712035

Comment 15 by sdy@chromium.org, May 16 2017

Blockedon: 723002

Comment 16 by sdy@chromium.org, Jul 18 2017

Blocking: -605219 -589943

Comment 17 by sdy@chromium.org, Oct 13 2017

Cc: sdy@chromium.org
Owner: ----
Status: Available (was: Started)
There were perf regressions, so it's unclear if turning on Auto Layout is desirable at all. Marking available for now.
Status: Archived (was: Available)
Archiving old bugs that haven't been actively assigned in over 180 days.

If you feel this issue should still be addressed, feel free to reopen it or to file a new issue. Thanks!

Sign in to add a comment