Bug 162531

Summary: [WK2] anchor.download attribute value is ignored by NETWORK_SESSION code path
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, bfulgham, cdumez, commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jsfiddle.net/cW7W5/1584/
See Also: https://bugs.webkit.org/show_bug.cgi?id=156099
Bug Depends on:    
Bug Blocks: 156056, 162535    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2016-09-24 09:53:52 PDT
anchor.download attribute value is ignored when href contains a data URL.

Test case:
http://jsfiddle.net/cW7W5/1582/

It should download the file as icon.gif but doesn't.
Comment 1 Chris Dumez 2016-09-24 09:59:55 PDT
Actual test case:
http://jsfiddle.net/cW7W5/1584/
Comment 2 Chris Dumez 2016-09-24 10:01:57 PDT
We call WebFrame::startDownload() with the right URL and suggestedName. However, the suggested name apparently gets ignored later on somehow.
Comment 3 Chris Dumez 2016-09-24 10:03:45 PDT
Oh, it looks like the new NETWORK_SESSION code path completely ignores 'suggestedName' on Network process side. This bug is not specific to data URLs.
Comment 4 Chris Dumez 2016-09-24 10:05:34 PDT
Should be trivial to fix. I'll look into it after I am done with Bug 156099.
Comment 5 Chris Dumez 2016-09-24 16:04:54 PDT
Created attachment 289764 [details]
Patch
Comment 6 Chris Dumez 2016-09-24 18:02:22 PDT
Comment on attachment 289764 [details]
Patch

Clearing flags on attachment: 289764

Committed r206355: <http://trac.webkit.org/changeset/206355>
Comment 7 Chris Dumez 2016-09-24 18:02:27 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Chris Dumez 2016-09-24 19:10:16 PDT
*** Bug 156067 has been marked as a duplicate of this bug. ***