-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"If either the a element has a download attribut..." #2116
Comments
…r-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: - whatwg/html#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: http://svn.webkit.org/repository/webkit/trunk@209091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simple demo: I guess we should change the standard, but it does seem rather annoying to just let sites download stuff without user interaction. (In Firefox you do still get a prompt, in Chrome it goes directly into the Downloads/ folder.) |
It is already possible to download stuff without user interaction without the
|
That is, that calling .click() does not throw at least, as it used to per-spec. Matches the HTML change at whatwg/html#2136 per the HTML bug report at whatwg/html#2116.
That is, that calling .click() does not throw at least, as it used to per-spec. Matches the HTML change at whatwg/html#2136 per the HTML bug report at whatwg/html#2116.
Fixes whatwg#2116, wherein it is documented that this restriction is not supported in any existing engines and attempting to do so in WebKit proved not web-compatible. Also helps with whatwg#1431.
https://html.spec.whatwg.org/#the-a-element
Both Gecko and Blink seem to allow synthetic clicks on anchors that have a download attribute. WebKit used to follow the specification here but it caused compatibility issues. Therefore, we are relaxing the requirements and allowing synthetic clicks:
https://bugs.webkit.org/show_bug.cgi?id=165148
Should we update the specification to match the behavior of existing browsers, especially considering matching the specification (if I understand the specification correctly) seems to break existing Web content.
The text was updated successfully, but these errors were encountered: