Title: [243485] trunk/Source/WebKit
Revision
243485
Author
[email protected]
Date
2019-03-25 22:48:08 -0700 (Mon, 25 Mar 2019)

Log Message

Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
https://bugs.webkit.org/show_bug.cgi?id=196205
<rdar://problem/49083324>

Reviewed by Geoffrey Garen.

Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
wild cards (e.g. "image/*") that are defined in the HTML specification:
- https://html.spec.whatwg.org/multipage/input.html#attr-input-accept

Previously, we would fail to convert those to UTIs.

* UIProcess/ios/forms/WKFileUploadPanel.mm:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (243484 => 243485)


--- trunk/Source/WebKit/ChangeLog	2019-03-26 04:45:13 UTC (rev 243484)
+++ trunk/Source/WebKit/ChangeLog	2019-03-26 05:48:08 UTC (rev 243485)
@@ -1,3 +1,19 @@
+2019-03-25  Chris Dumez  <[email protected]>
+
+        Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
+        https://bugs.webkit.org/show_bug.cgi?id=196205
+        <rdar://problem/49083324>
+
+        Reviewed by Geoffrey Garen.
+
+        Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
+        wild cards (e.g. "image/*") that are defined in the HTML specification:
+        - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
+
+        Previously, we would fail to convert those to UTIs.
+
+        * UIProcess/ios/forms/WKFileUploadPanel.mm:
+
 2019-03-25  Tim Horton  <[email protected]>
 
         Remove some now-unnecessary dynamic class lookup

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (243484 => 243485)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm	2019-03-26 04:45:13 UTC (rev 243484)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm	2019-03-26 05:48:08 UTC (rev 243485)
@@ -318,9 +318,17 @@
 {
     NSMutableSet *mediaTypes = [NSMutableSet set];
     for (NSString *mimeType in mimeTypes) {
-        auto uti = WebCore::UTIFromMIMEType(mimeType);
-        if (!uti.isEmpty())
-            [mediaTypes addObject:(__bridge NSString *)uti];
+        if ([mimeType caseInsensitiveCompare:@"image/*"] == NSOrderedSame)
+            [mediaTypes addObject:(__bridge NSString *)kUTTypeImage];
+        else if ([mimeType caseInsensitiveCompare:@"video/*"] == NSOrderedSame)
+            [mediaTypes addObject:(__bridge NSString *)kUTTypeMovie];
+        else if ([mimeType caseInsensitiveCompare:@"audio/*"] == NSOrderedSame)
+            [mediaTypes addObject:(__bridge NSString *)kUTTypeAudio];
+        else {
+            auto uti = WebCore::UTIFromMIMEType(mimeType);
+            if (!uti.isEmpty())
+                [mediaTypes addObject:(__bridge NSString *)uti];
+        }
     }
     return mediaTypes;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to