[Extra zoom mode] Suppress UI for inputs of type file in extra zoom mode
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2018 21:58:54 +0000 (21:58 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2018 21:58:54 +0000 (21:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184556
<rdar://problem/39062239>

Reviewed by Andy Estes.

When running in this mode, we don't have the facilities to present document picker UI. For now, just make this
feature fail gracefully.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel presentWithParameters:resultListener:]):
(-[WKFileUploadPanel platformSupportsPickerViewController]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230600 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm

index 3d07b00..33fe5ad 100644 (file)
@@ -1,3 +1,18 @@
+2018-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Extra zoom mode] Suppress UI for inputs of type file in extra zoom mode
+        https://bugs.webkit.org/show_bug.cgi?id=184556
+        <rdar://problem/39062239>
+
+        Reviewed by Andy Estes.
+
+        When running in this mode, we don't have the facilities to present document picker UI. For now, just make this
+        feature fail gracefully.
+
+        * UIProcess/ios/forms/WKFileUploadPanel.mm:
+        (-[WKFileUploadPanel presentWithParameters:resultListener:]):
+        (-[WKFileUploadPanel platformSupportsPickerViewController]):
+
 2018-04-12  Megan Gardner  <megan_gardner@apple.com>
 
         Remove block selection code
index d9ce32b..5415ee1 100644 (file)
@@ -243,6 +243,11 @@ static inline UIImage *cameraIcon()
     _mediaCaptureType = parameters->mediaCaptureType();
 #endif
 
+    if (![self platformSupportsPickerViewController]) {
+        [self _cancel];
+        return;
+    }
+
     if ([self _shouldMediaCaptureOpenMediaDevice]) {
         [self _adjustMediaCaptureType];
 
@@ -702,6 +707,15 @@ static NSArray *UTIsForMIMETypes(NSArray *mimeTypes)
     [self _uploadItemForJPEGRepresentationOfImage:originalImage successBlock:successBlock failureBlock:failureBlock];
 }
 
+- (BOOL)platformSupportsPickerViewController
+{
+#if ENABLE(EXTRA_ZOOM_MODE)
+    return NO;
+#else
+    return YES;
+#endif
+}
+
 @end
 
 #pragma clang diagnostic pop