Skip to content
Permalink
Browse files
Workaround for UIKit layout bug in time picker.
https://bugs.webkit.org/show_bug.cgi?id=213346
<rdar://problem/64042277>

Reviewed by Tim Horton.

There is a bug in the layout of UIKit that needs to be fixed.
Until then, this workaround should give us a view that is viable.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView resignFirstResponderForWebView]):
* UIProcess/ios/forms/WKDateTimeInputControl.mm:
(-[WKDateTimeContextMenuViewController preferredContentSize]):


Canonical link: https://commits.webkit.org/226149@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
megangardner committed Jun 18, 2020
1 parent 9bb48f6 commit 3c8fb351fb5c2994e6ff5628163c86c4330c036b
Showing 2 changed files with 26 additions and 1 deletion.
@@ -1,3 +1,19 @@
2020-06-18 Megan Gardner <megan_gardner@apple.com>

Workaround for UIKit layout bug in time picker.
https://bugs.webkit.org/show_bug.cgi?id=213346
<rdar://problem/64042277>

Reviewed by Tim Horton.

There is a bug in the layout of UIKit that needs to be fixed.
Until then, this workaround should give us a view that is viable.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView resignFirstResponderForWebView]):
* UIProcess/ios/forms/WKDateTimeInputControl.mm:
(-[WKDateTimeContextMenuViewController preferredContentSize]):

2020-06-18 David Kilzer <ddkilzer@apple.com>

[IPC hardening] OptionSet<> values should be validated
@@ -79,7 +79,16 @@ @implementation WKDateTimeContextMenuViewController

- (CGSize)preferredContentSize
{
return [self.view systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
// FIXME: Workaround, should be able to be readdressed after <rdar://problem/64143534>
UIView *view = self.view;
if (UIEdgeInsetsEqualToEdgeInsets(view.layoutMargins, UIEdgeInsetsZero)) {
view.translatesAutoresizingMaskIntoConstraints = NO;
[view layoutIfNeeded];
view.translatesAutoresizingMaskIntoConstraints = YES;
view.layoutMargins = UIEdgeInsetsMake(16, 16, 16, 16);
}

return [view systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
}

@end

0 comments on commit 3c8fb35

Please sign in to comment.