Title: [263232] trunk/Source/WebKit
Revision
263232
Author
megan_gard...@apple.com
Date
2020-06-18 15:16:25 -0700 (Thu, 18 Jun 2020)

Log Message

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]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (263231 => 263232)


--- trunk/Source/WebKit/ChangeLog	2020-06-18 22:11:22 UTC (rev 263231)
+++ trunk/Source/WebKit/ChangeLog	2020-06-18 22:16:25 UTC (rev 263232)
@@ -1,3 +1,19 @@
+2020-06-18  Megan Gardner  <megan_gard...@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  <ddkil...@apple.com>
 
         [IPC hardening] OptionSet<> values should be validated

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm (263231 => 263232)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm	2020-06-18 22:11:22 UTC (rev 263231)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm	2020-06-18 22:16:25 UTC (rev 263232)
@@ -79,7 +79,16 @@
 
 - (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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to