RESOLVED FIXED 169060
[WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
https://bugs.webkit.org/show_bug.cgi?id=169060
Summary [WK2][!NETWORK_SESSION] Failure to download when using a download attribute w...
Chris Dumez
Reported 2017-03-01 14:38:27 PST
Failure to download when using a download attribute with no value on an anchor.
Attachments
Patch (4.47 KB, patch)
2017-03-01 14:49 PST, Chris Dumez
no flags
Patch (6.15 KB, patch)
2017-03-01 15:31 PST, Chris Dumez
no flags
Patch (9.79 KB, patch)
2017-03-01 16:00 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-03-01 14:38:56 PST
Chris Dumez
Comment 2 2017-03-01 14:49:31 PST
Darin Adler
Comment 3 2017-03-01 15:00:58 PST
Comment on attachment 303127 [details] Patch What about a download attribute with a value that consists entirely of whitespace? Many properties like this one strip leading and trailing HTML spaces; does this one do that?
Darin Adler
Comment 4 2017-03-01 15:01:22 PST
Comment on attachment 303127 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303127&action=review > Source/WebKit2/ChangeLog:11 > + up passing an empty string as suggested filename to Safari which is ot handled properly. ot -> not
Darin Adler
Comment 5 2017-03-01 15:02:03 PST
Comment on attachment 303127 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303127&action=review > Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp:204 > + String suggestedFilename = MIMETypeRegistry::appendFileExtensionIfNecessary(m_suggestedFilename.isEmpty() ? filename : m_suggestedFilename, mimeType); Might also want to change the code so it never sets m_suggestedFilename to an empty string.
Chris Dumez
Comment 6 2017-03-01 15:07:53 PST
(In reply to comment #3) > Comment on attachment 303127 [details] > Patch > > What about a download attribute with a value that consists entirely of > whitespace? Many properties like this one strip leading and trailing HTML > spaces; does this one do that? We do not strip spaces: - Safari: creates a file with only whitespaces in the name - Firefox: creates a file with only whitespaces in the name - Chrome: creates a file with name "- -.jpeg" (i.e. sanitizes so first and last character cannot be whitespace)
Chris Dumez
Comment 7 2017-03-01 15:31:39 PST
Chris Dumez
Comment 8 2017-03-01 15:32:54 PST
(In reply to comment #5) > Comment on attachment 303127 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=303127&action=review > > > Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp:204 > > + String suggestedFilename = MIMETypeRegistry::appendFileExtensionIfNecessary(m_suggestedFilename.isEmpty() ? filename : m_suggestedFilename, mimeType); > > Might also want to change the code so it never sets m_suggestedFilename to > an empty string. Done in the latest iteration. Requesting review again because of this extra change.
Chris Dumez
Comment 9 2017-03-01 16:00:36 PST
Chris Dumez
Comment 10 2017-03-01 16:27:24 PST
Comment on attachment 303139 [details] Patch Clearing flags on attachment: 303139 Committed r213253: <http://trac.webkit.org/changeset/213253>
Chris Dumez
Comment 11 2017-03-01 16:27:31 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.