Can't download move.simple.com direct deposit transition PDF: Non user-triggered...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Nov 2016 22:38:26 +0000 (22:38 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Nov 2016 22:38:26 +0000 (22:38 +0000)
commit63545a0b9ff6a550af169cf0ab1b320e32cedd9f
treeb8fc339da1715b7f2b5c352ea50e1a147b3c6f7e
parenta88f34a83b7a5fe7ad1b5017dd06df9f6f21e6cf
Can't download move.simple.com direct deposit transition PDF: Non user-triggered activations of anchors that have a download attribute are ignored
https://bugs.webkit.org/show_bug.cgi?id=165148
<rdar://problem/29421771>

Reviewed by Daniel Bates.

Source/WebCore:

We were ignoring non user-triggered activations of anchors that have a
download attribute which is stricter than Chrome and Firefox and breaks
downloads on move.simple.com. This patch relaxes our policy to allow
simulated clicks on such links, similarly to other browsers.

Web authors can anyway already trigger downloads using script by setting
window.location to a specific URL and serving to right HTTP headers to
trigger a download.

Note that our previous behavior matches the current version of the
specification so I also filed a bug against the HTML specification to
see if we can get it changed to match the behavior of browsers:
- https://github.com/whatwg/html/issues/2116

No new tests, updated existing test.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):

LayoutTests:

Update existing test to reflect behavior change.

* fast/dom/HTMLAnchorElement/anchor-download-synthetic-click-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-download-synthetic-click.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLAnchorElement/anchor-download-synthetic-click-expected.txt
LayoutTests/fast/dom/HTMLAnchorElement/anchor-download-synthetic-click.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAnchorElement.cpp