Tracking bug for enabling Auto Layout on Mac |
|||||||||||||
Issue description-
,
Mar 7 2017
,
Mar 7 2017
,
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
,
Mar 16 2017
,
Mar 17 2017
,
Mar 17 2017
,
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
,
Mar 23 2017
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.
,
Mar 23 2017
Thanks for remembering! This is in today's Canary (59.0.3049.0), fwiw.
,
Mar 24 2017
Thanks, Shrike@! I'll see how this can be better incorporated into the basic acceptance testing test coverage.
,
Apr 10 2017
Auto layout is back off due to a performance regression.
,
Apr 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8b7a7716bedcc5120cafc3df7ecb61aa542a1089 commit 8b7a7716bedcc5120cafc3df7ecb61aa542a1089 Author: sdy <sdy@chromium.org> Date: Mon Apr 10 17:35:04 2017 Turn off Auto Layout pending investigation of a performance regression. BUG= 706931 , 695577 Review-Url: https://codereview.chromium.org/2811793002 Cr-Commit-Position: refs/heads/master@{#463311} [modify] https://crrev.com/8b7a7716bedcc5120cafc3df7ecb61aa542a1089/chrome/browser/ui/cocoa/browser_window_controller_unittest.mm [modify] https://crrev.com/8b7a7716bedcc5120cafc3df7ecb61aa542a1089/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
,
May 10 2017
,
May 16 2017
,
Oct 13 2017
There were perf regressions, so it's unclear if turning on Auto Layout is desirable at all. Marking available for now.
,
Sep 13
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 |
|||||||||||||
Comment 1 by sdy@chromium.org
, Mar 7 2017