Summary: | [iOS] Unable to select files when the accept attribute is set to "*/*" | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Lee Nave <nave> | ||||||
Component: | Forms | Assignee: | Aditya Keerthi <akeerthi> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | aestes, akeerthi, cdumez, kevin_neal, sabouhallawa, thorton, webkit-bug-importer, wenson_hsieh | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | Safari 14 | ||||||||
Hardware: | iPhone / iPad | ||||||||
OS: | iOS 14 | ||||||||
Attachments: |
|
Description
Lee Nave
2021-08-24 11:19:37 PDT
"*/*" actually seems like a valid value according to the spec: - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept says "A valid MIME type string with no parameters" points to: - https://mimesniff.spec.whatwg.org/#valid-mime-type-with-no-parameters which points to: - https://mimesniff.spec.whatwg.org/#valid-mime-type which points to: - https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.1 says: media-type = type "/" subtype *( OWS ";" OWS parameter ) type = token subtype = token type and subtype are both tokens, defined here: - https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6 so it seems like '*' is a valid token. Ah, you're right, thanks! Created attachment 436422 [details]
Patch
Comment on attachment 436422 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436422&action=review r=me with comment > Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:358 > + if ([mimeType caseInsensitiveCompare:@"*/*"] == NSOrderedSame) nit: Do we really need a caseInsensitiveCompare for "*/*"? Created attachment 436425 [details]
Patch
(In reply to Chris Dumez from comment #5) > Comment on attachment 436422 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=436422&action=review > > r=me with comment Thanks for the review! > > Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:358 > > + if ([mimeType caseInsensitiveCompare:@"*/*"] == NSOrderedSame) > > nit: Do we really need a caseInsensitiveCompare for "*/*"? Uploaded a new patch using `isEqualToString:`. Committed r281612 (240968@main): <https://commits.webkit.org/240968@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 436425 [details]. I just have to say, I'm really impressed with how quickly this bug was fixed. My first time cutting a WebKit issue and was expecting this to sit uncommented and then closed eventually for "no activity" or any of the other outcomes that seem common with large open-source projects supported by any of the Big 5. Very glad to be proven wrong. My only complaints is that I was looking forward to figuring out WebKit development and fixing it myself :-) |