⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243485 in webkit


Ignore:
Timestamp:
Mar 25, 2019, 10:48:08 PM (7 years ago)
Author:
Chris Dumez
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:

Previously, we would fail to convert those to UTIs.

  • UIProcess/ios/forms/WKFileUploadPanel.mm:
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r243484 r243485  
     12019-03-25  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
     4        https://bugs.webkit.org/show_bug.cgi?id=196205
     5        <rdar://problem/49083324>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
     10        wild cards (e.g. "image/*") that are defined in the HTML specification:
     11        - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
     12
     13        Previously, we would fail to convert those to UTIs.
     14
     15        * UIProcess/ios/forms/WKFileUploadPanel.mm:
     16
    1172019-03-25  Tim Horton  <timothy_horton@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm

    r243168 r243485  
    319319    NSMutableSet *mediaTypes = [NSMutableSet set];
    320320    for (NSString *mimeType in mimeTypes) {
    321         auto uti = WebCore::UTIFromMIMEType(mimeType);
    322         if (!uti.isEmpty())
    323             [mediaTypes addObject:(__bridge NSString *)uti];
     321        if ([mimeType caseInsensitiveCompare:@"image/*"] == NSOrderedSame)
     322            [mediaTypes addObject:(__bridge NSString *)kUTTypeImage];
     323        else if ([mimeType caseInsensitiveCompare:@"video/*"] == NSOrderedSame)
     324            [mediaTypes addObject:(__bridge NSString *)kUTTypeMovie];
     325        else if ([mimeType caseInsensitiveCompare:@"audio/*"] == NSOrderedSame)
     326            [mediaTypes addObject:(__bridge NSString *)kUTTypeAudio];
     327        else {
     328            auto uti = WebCore::UTIFromMIMEType(mimeType);
     329            if (!uti.isEmpty())
     330                [mediaTypes addObject:(__bridge NSString *)uti];
     331        }
    324332    }
    325333    return mediaTypes;
Note: See TracChangeset for help on using the changeset viewer.