Bug 85044

Summary: [BlackBerry] Support html5 download attribute
Product: WebKit Reporter: Mary Wu <mawu>
Component: WebKit BlackBerryAssignee: Mary Wu <mawu>
Status: RESOLVED FIXED    
Severity: Normal CC: joenotcharles, leo.yang, liachen, logingx, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Mary Wu 2012-04-27 02:56:08 PDT
The Spec:
======================================
4.12.4 Downloading resources

In some cases, resources are intended for later use rather than immediate
viewing. To indicate that a resource is intended to be downloaded for use
later, rather than immediately used, the download attribute can be specified on
the a or area element that creates the hyperlink to that resource.

The attribute can furthermore be given a value, to specify the filename that
user agents are to use when storing the resource in a file system. This value
can be overridden by the Content-Disposition HTTP header's filename parameters.
[RFC6266]

Steps to Reproduce:
=======================================
1. Navigate to
http://updates.html5rocks.com/2011/08/Downloading-resources-in-HTML5-a-download
with PlayBook browser
2. Click the "download me" hyper-link in the page. The HTML for it:
<a href="http://www.google.com/.../logo2w.png" download="MyGoogleLogo">download
me</a>

Expected result:
=======================================
The download dialogue will pop up with file name as "MyGoogleLogo.png", which
is the value of the download attribute.
Comment 1 Mary Wu 2012-04-27 03:22:06 PDT
Created attachment 139163 [details]
Patch
Comment 2 Joe Mason 2012-04-27 20:37:41 PDT
setSuggestSaveName should be setSuggestedSaveName. Too tired to look at the rest right now.
Comment 3 Lyon Chen 2012-04-30 07:10:26 PDT
(In reply to comment #1)
> Created an attachment (id=139163) [details]
> Patch

Looks good to me.
Comment 4 Chris.Guan 2012-05-01 19:07:44 PDT
Mary, did you test CrossThreadResourceRequestData or redirect?
Comment 5 Joe Mason 2012-05-02 07:35:03 PDT
(In reply to comment #4)
> Mary, did you test CrossThreadResourceRequestData or redirect?
 
Good catch - the new member variable needs to be added to that too.  Also I just noticed it's missing m_overrideContentType and m_targetType.
Comment 6 Mary Wu 2012-05-02 18:20:40 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > Mary, did you test CrossThreadResourceRequestData or redirect?
> 
> Good catch - the new member variable needs to be added to that too.  Also I just noticed it's missing m_overrideContentType and m_targetType.

thanks, will add in CrossThreadResourceRequestData. also for the missing members, will create separate pr to track.
Comment 7 Mary Wu 2012-05-02 18:40:46 PDT
Created attachment 139936 [details]
Patch
Comment 8 Joe Mason 2012-05-02 19:25:52 PDT
LGTM
Comment 9 WebKit Review Bot 2012-05-03 17:29:25 PDT
Comment on attachment 139936 [details]
Patch

Rejecting attachment 139936 [details] from commit-queue.

mary.wu@torchmobile.com.cn does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 10 WebKit Review Bot 2012-05-03 21:25:05 PDT
Comment on attachment 139936 [details]
Patch

Rejecting attachment 139936 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
ED at 244.
2 out of 3 hunks FAILED -- saving rejects to file Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp.rej
patching file Source/WebKit/blackberry/Api/WebPage.cpp
patching file Source/WebKit/blackberry/Api/WebPage_p.h
patching file Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Antonio Go..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/12507050
Comment 11 Mary Wu 2012-05-06 20:10:27 PDT
Created attachment 140462 [details]
Patch
Comment 12 WebKit Review Bot 2012-05-06 21:08:56 PDT
Comment on attachment 140462 [details]
Patch

Clearing flags on attachment: 140462

Committed r116265: <http://trac.webkit.org/changeset/116265>
Comment 13 WebKit Review Bot 2012-05-06 21:09:01 PDT
All reviewed patches have been landed.  Closing bug.