Title: [275914] trunk/Source/WebKit
Revision
275914
Author
akeer...@apple.com
Date
2021-04-13 14:54:35 -0700 (Tue, 13 Apr 2021)

Log Message

[iOS][FCR] Color picker sheet should use default height
https://bugs.webkit.org/show_bug.cgi?id=224371
<rdar://problem/76416775>

Reviewed by Wenson Hsieh.

System color pickers have a default height that is between a half-sheet
and a full sheet. WebKit should match the default so that users do not
need to swipe up and down to access all of the controls in the color
picker.

* UIProcess/ios/forms/WKFormColorControl.mm:
(-[WKColorPicker configurePresentation]):

Always use UIModalPresentationPopover when presenting the
UIColorPickerViewController. In compact environments, this style
behaves the same as UIModalPresentationFormSheet, and the presented
height of the color picker matches the system default.

This method of presentation matches the logic in UIColorWell.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (275913 => 275914)


--- trunk/Source/WebKit/ChangeLog	2021-04-13 21:44:32 UTC (rev 275913)
+++ trunk/Source/WebKit/ChangeLog	2021-04-13 21:54:35 UTC (rev 275914)
@@ -1,3 +1,26 @@
+2021-04-13  Aditya Keerthi  <akeer...@apple.com>
+
+        [iOS][FCR] Color picker sheet should use default height
+        https://bugs.webkit.org/show_bug.cgi?id=224371
+        <rdar://problem/76416775>
+
+        Reviewed by Wenson Hsieh.
+
+        System color pickers have a default height that is between a half-sheet
+        and a full sheet. WebKit should match the default so that users do not
+        need to swipe up and down to access all of the controls in the color
+        picker.
+
+        * UIProcess/ios/forms/WKFormColorControl.mm:
+        (-[WKColorPicker configurePresentation]):
+
+        Always use UIModalPresentationPopover when presenting the
+        UIColorPickerViewController. In compact environments, this style
+        behaves the same as UIModalPresentationFormSheet, and the presented
+        height of the color picker matches the system default.
+
+        This method of presentation matches the logic in UIColorWell.
+
 2021-04-13  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [macOS] Refactor logic for presenting the shared QLPreviewPanel when revealing an image

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorControl.mm (275913 => 275914)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorControl.mm	2021-04-13 21:44:32 UTC (rev 275913)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorControl.mm	2021-04-13 21:54:35 UTC (rev 275914)
@@ -96,22 +96,12 @@
 
 - (void)configurePresentation
 {
-    if (WebKit::currentUserInterfaceIdiomIsPadOrMac()) {
-        [_colorPickerViewController setModalPresentationStyle:UIModalPresentationPopover];
-        UIPopoverPresentationController *presentationController = [_colorPickerViewController popoverPresentationController];
-        presentationController.delegate = self;
-        presentationController.sourceView = _view;
-        presentationController.sourceRect = CGRectIntegral(_view.focusedElementInformation.interactionRect);
-    } else {
-        UIPresentationController *presentationController = [_colorPickerViewController presentationController];
-        presentationController.delegate = self;
-        if ([presentationController isKindOfClass:[_UISheetPresentationController class]]) {
-            _UISheetPresentationController *sheetPresentationController = (_UISheetPresentationController *)presentationController;
-            sheetPresentationController._detents = @[_UISheetDetent._mediumDetent, _UISheetDetent._largeDetent];
-            sheetPresentationController._widthFollowsPreferredContentSizeWhenBottomAttached = YES;
-            sheetPresentationController._wantsBottomAttachedInCompactHeight = YES;
-        }
-    }
+    [_colorPickerViewController setModalPresentationStyle:UIModalPresentationPopover];
+
+    UIPopoverPresentationController *presentationController = [_colorPickerViewController popoverPresentationController];
+    presentationController.delegate = self;
+    presentationController.sourceView = _view;
+    presentationController.sourceRect = CGRectIntegral(_view.focusedElementInformation.interactionRect);
 }
 
 #pragma mark WKFormControl
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to