Commit badd7614 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

Fix omnibox popup suggestions on rotation on iOS 11.

It seems like on iOS 11 the autoresize masks don't work well when the
device is rotated. Since suggestions rows don't really need the mask
since the frame of each view is exactly calculated and set every time it
changes the size, remove the use of autoresize masks.

including long and short suggestions, answers; specifically verify that
text is not clipped in unexpected ways even when rotating to landscape
and back.

Bug: 768374
Test: Please test by displaying all possible suggestions in omnibox,
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ia00b60187b3d99e7e09dcd82d107c6a809492316
Reviewed-on: https://chromium-review.googlesource.com/760937
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516313}
parent 02293324
...@@ -58,20 +58,17 @@ const CGFloat kAppendButtonSize = 48.0; ...@@ -58,20 +58,17 @@ const CGFloat kAppendButtonSize = 48.0;
_textTruncatingLabel = _textTruncatingLabel =
[[OmniboxPopupTruncatingLabel alloc] initWithFrame:CGRectZero]; [[OmniboxPopupTruncatingLabel alloc] initWithFrame:CGRectZero];
_textTruncatingLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_textTruncatingLabel.userInteractionEnabled = NO; _textTruncatingLabel.userInteractionEnabled = NO;
[self.contentView addSubview:_textTruncatingLabel]; [self.contentView addSubview:_textTruncatingLabel];
_detailTruncatingLabel = _detailTruncatingLabel =
[[OmniboxPopupTruncatingLabel alloc] initWithFrame:CGRectZero]; [[OmniboxPopupTruncatingLabel alloc] initWithFrame:CGRectZero];
_detailTruncatingLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_detailTruncatingLabel.userInteractionEnabled = NO; _detailTruncatingLabel.userInteractionEnabled = NO;
[self.contentView addSubview:_detailTruncatingLabel]; [self.contentView addSubview:_detailTruncatingLabel];
// Answers use a UILabel with NSLineBreakByTruncatingTail to produce a // Answers use a UILabel with NSLineBreakByTruncatingTail to produce a
// truncation with an ellipse instead of fading on multi-line text. // truncation with an ellipse instead of fading on multi-line text.
_detailAnswerLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _detailAnswerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_detailAnswerLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_detailAnswerLabel.userInteractionEnabled = NO; _detailAnswerLabel.userInteractionEnabled = NO;
_detailAnswerLabel.lineBreakMode = NSLineBreakByTruncatingTail; _detailAnswerLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[self.contentView addSubview:_detailAnswerLabel]; [self.contentView addSubview:_detailAnswerLabel];
......
...@@ -273,8 +273,6 @@ UIColor* BackgroundColorIncognito() { ...@@ -273,8 +273,6 @@ UIColor* BackgroundColorIncognito() {
frame.origin.y = kTextCellTopPadding; frame.origin.y = kTextCellTopPadding;
textLabel.frame = frame; textLabel.frame = frame;
} }
textLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[textLabel setNeedsDisplay];
// The leading image (e.g. magnifying glass, star, clock) is only shown on // The leading image (e.g. magnifying glass, star, clock) is only shown on
// iPad. // iPad.
...@@ -318,6 +316,8 @@ UIColor* BackgroundColorIncognito() { ...@@ -318,6 +316,8 @@ UIColor* BackgroundColorIncognito() {
frame.origin.x = kLTRTextInRTLLayoutLeftPadding; frame.origin.x = kLTRTextInRTLLayoutLeftPadding;
detailTextLabel.frame = frame; detailTextLabel.frame = frame;
} }
[textLabel setNeedsDisplay];
} }
- (void)layoutRows { - (void)layoutRows {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment