Summary: | [iOS] Improve our file picker | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | Forms | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | aestes, bdakin, cdumez, commit-queue, thorton, webkit-bug-importer, wenson_hsieh | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=195955 | ||||||||
Bug Depends on: | 195955 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Chris Dumez
2019-03-04 10:11:55 PST
Created attachment 363523 [details]
Patch
Comment on attachment 363523 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=363523&action=review > Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:321 > + if (auto UTI = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (CFStringRef)mimeType, NULL))) Can this use UTIUtilities' UTIFromMIMEType? Comment on attachment 363523 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=363523&action=review > Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:60 > +static bool arrayContainsUTIThatConformsTo(NSArray* utis, CFStringRef conformToUTI) Nit - This type should be NSArray<NSString *> *. "utis" is also a bit of a strange variable name...perhaps "typeIdentifiers" or just "types"? > Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:62 > + for (id uti in utis) { NSString * > Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:63 > + if (UTTypeConformsTo((CFStringRef)uti, conformToUTI)) (__bridge CFStringRef) > Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:322 > + [mediaTypes addObject:(NSString *)UTI.get()]; (__bridge NSString *) > Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:363 > + NSArray *documentTypes = mediaTypes.count ? mediaTypes : @[@"public.item"]; Nit - This isn't new code, but maybe consider using the kUTTypeItem constant instead of @"public.item"? Created attachment 363532 [details]
Patch
Comment on attachment 363532 [details] Patch Clearing flags on attachment: 363532 Committed r242369: <https://trac.webkit.org/changeset/242369> All reviewed patches have been landed. Closing bug. |