When leaving the stack view, the omnibox' width is incorrect. |
|||||||||
Issue descriptionTo reproduce the problem: (1) On iPhone, enable the "Safe area compatible toolbar" experimental flag. (2) Relaunch chrome. (3) Visit a website (e.g. wikipedia). (4) Enter the Stack View. (5) Exit the Stack View. Notice how the omnibox is incorrectly sized.
,
Oct 13 2017
M-63 Hotlist-iOS11 Hotlist-iPhoneX
,
Oct 13 2017
Adding:
- (void)setBounds:(CGRect)bounds {
if (bounds.size.width != 0)
[super setBounds:bounds];
}
to the toolbar_view.mm fixes the problem.
,
Oct 13 2017
The omnibox is a (roughly) a subview of the toolbar. It resizes itself with autoresizing masks: [-(fixed leading margin)-[omnibox]-(fixed trailing margin)-] The problem happens because when the width of the toolbar is set to 0, UIKit changes "fixed leading margin" and "fixed trailing margin" to 0 to avoid having the width of the omnibox be negative. Afterwards, when the toolbar is sized correctly, the omnibox' margins are incorrect. I don't understand why the stackview animation results in the bounds of the toolbar being set to 0.
,
Oct 13 2017
If I comment out the line doing the reparenting of the toolbarview:
[_activeCardSet.displayView
insertSubview:self.transitionToolbarController.view
aboveSubview:_activeCardSet.currentCard.view];
the "setBounds:CGRectZero" is not called.
,
Oct 19 2017
Hey jif@ are you making some progress on this iPhoneX issue?
,
Oct 20 2017
Issue 773394 has been merged into this issue.
,
Oct 20 2017
This is the main thing I'm working on.
,
Oct 23 2017
,
Oct 24 2017
,
Oct 24 2017
@jif should I change the status to fixed?
,
Oct 24 2017
Only once https://chromium-review.googlesource.com/c/chromium/src/+/733163 lands
,
Oct 25 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bead99874c0f63f1ddf66963cd1af613b4a6531e commit bead99874c0f63f1ddf66963cd1af613b4a6531e Author: Jean-François Geyelin <jif@chromium.org> Date: Wed Oct 25 11:52:07 2017 [iOS] Prevent the omnibox from being squashed. The toolbar contains subviews positioned with autoresizing masks. The margins used by the autoresizing masks get squashed if the toolbar's width is set to 0. The toolbar's width is set to 0 when the toolbar is moved out of the view hierarchy. In order to prevent this, this CL adds a constraint on the minimal toolbar width. To have this constraint stick around required *not* removing all of the toolbar's constraints when the toolbar changed superview (i.e. *not* calling |[self removeConstraints:self.constraints];| from |-willMoveToSuperview:|). In turn, not automatically removing constraints meant that the constraint on the height of the toolbar (unlike the leading/trailing/top constraints which were attached to anchors and thus automatically removed when the view is reparented) was not getting automatically removed when the toolbar was reparented. This is why this CL moves the ownership of the height constraint out of the BVC/NTP, and into the ToolbarController. This CL also makes the StackView's toolbar be positioned with autolayout (and respond to safe area changes). Bug: 773640 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I2e9b3a59bf80f53c22285aff1595f79df54daefe Reviewed-on: https://chromium-review.googlesource.com/733163 Commit-Queue: Jean-François Geyelin <jif@chromium.org> Reviewed-by: Mark Cogan <marq@chromium.org> Cr-Commit-Position: refs/heads/master@{#511420} [modify] https://crrev.com/bead99874c0f63f1ddf66963cd1af613b4a6531e/ios/chrome/browser/ui/browser_view_controller.mm [modify] https://crrev.com/bead99874c0f63f1ddf66963cd1af613b4a6531e/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm [modify] https://crrev.com/bead99874c0f63f1ddf66963cd1af613b4a6531e/ios/chrome/browser/ui/stack_view/BUILD.gn [modify] https://crrev.com/bead99874c0f63f1ddf66963cd1af613b4a6531e/ios/chrome/browser/ui/stack_view/stack_view_controller.mm [modify] https://crrev.com/bead99874c0f63f1ddf66963cd1af613b4a6531e/ios/chrome/browser/ui/toolbar/toolbar_controller.h [modify] https://crrev.com/bead99874c0f63f1ddf66963cd1af613b4a6531e/ios/chrome/browser/ui/toolbar/toolbar_controller.mm [modify] https://crrev.com/bead99874c0f63f1ddf66963cd1af613b4a6531e/ios/chrome/browser/ui/toolbar/toolbar_view.h [modify] https://crrev.com/bead99874c0f63f1ddf66963cd1af613b4a6531e/ios/chrome/browser/ui/toolbar/toolbar_view.mm
,
Oct 25 2017
,
Oct 25 2017
[Auto-generated comment by a script] We noticed that this issue is targeted for M-63; it appears the fix may have landed after branch point, meaning a merge might be required. Please confirm if a merge is required here - if so add Merge-Request-63 label, otherwise remove Merge-TBD label. Thanks.
,
Oct 26 2017
Verified on M64.0.3250.0 canary Device: iPhone7plus, iPhoneX simulator Omnibox looks good after entering and exiting the TabSwitcher. Verified by enabling the flag from chrome://flags.
,
Oct 27 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/29cb5aca7204e1d8b3a3149d203e7599d8d1e028 commit 29cb5aca7204e1d8b3a3149d203e7599d8d1e028 Author: Jean-François Geyelin <jif@chromium.org> Date: Fri Oct 27 14:16:01 2017 [iOS] Prevent the omnibox from being squashed. The toolbar contains subviews positioned with autoresizing masks. The margins used by the autoresizing masks get squashed if the toolbar's width is set to 0. The toolbar's width is set to 0 when the toolbar is moved out of the view hierarchy. In order to prevent this, this CL adds a constraint on the minimal toolbar width. To have this constraint stick around required *not* removing all of the toolbar's constraints when the toolbar changed superview (i.e. *not* calling |[self removeConstraints:self.constraints];| from |-willMoveToSuperview:|). In turn, not automatically removing constraints meant that the constraint on the height of the toolbar (unlike the leading/trailing/top constraints which were attached to anchors and thus automatically removed when the view is reparented) was not getting automatically removed when the toolbar was reparented. This is why this CL moves the ownership of the height constraint out of the BVC/NTP, and into the ToolbarController. This CL also makes the StackView's toolbar be positioned with autolayout (and respond to safe area changes). Bug: 773640 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I2e9b3a59bf80f53c22285aff1595f79df54daefe Reviewed-on: https://chromium-review.googlesource.com/733163 Commit-Queue: Jean-François Geyelin <jif@chromium.org> Reviewed-by: Mark Cogan <marq@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#511420}(cherry picked from commit bead99874c0f63f1ddf66963cd1af613b4a6531e) Reviewed-on: https://chromium-review.googlesource.com/741562 Reviewed-by: Jean-François Geyelin <jif@chromium.org> Cr-Commit-Position: refs/branch-heads/3239@{#262} Cr-Branched-From: adb61db19020ed8ecee5e91b1a0ea4c924ae2988-refs/heads/master@{#508578} [modify] https://crrev.com/29cb5aca7204e1d8b3a3149d203e7599d8d1e028/ios/chrome/browser/ui/browser_view_controller.mm [modify] https://crrev.com/29cb5aca7204e1d8b3a3149d203e7599d8d1e028/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm [modify] https://crrev.com/29cb5aca7204e1d8b3a3149d203e7599d8d1e028/ios/chrome/browser/ui/stack_view/BUILD.gn [modify] https://crrev.com/29cb5aca7204e1d8b3a3149d203e7599d8d1e028/ios/chrome/browser/ui/stack_view/stack_view_controller.mm [modify] https://crrev.com/29cb5aca7204e1d8b3a3149d203e7599d8d1e028/ios/chrome/browser/ui/toolbar/toolbar_controller.h [modify] https://crrev.com/29cb5aca7204e1d8b3a3149d203e7599d8d1e028/ios/chrome/browser/ui/toolbar/toolbar_controller.mm [modify] https://crrev.com/29cb5aca7204e1d8b3a3149d203e7599d8d1e028/ios/chrome/browser/ui/toolbar/toolbar_view.h [modify] https://crrev.com/29cb5aca7204e1d8b3a3149d203e7599d8d1e028/ios/chrome/browser/ui/toolbar/toolbar_view.mm
,
Nov 7 2017
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by jif@chromium.org
, Oct 11 2017