Changeset 209091 in webkit
- Timestamp:
- Nov 29, 2016 2:38:26 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r209082 r209091 1 2016-11-29 Chris Dumez <cdumez@apple.com> 2 3 Can't download move.simple.com direct deposit transition PDF: Non user-triggered activations of anchors that have a download attribute are ignored 4 https://bugs.webkit.org/show_bug.cgi?id=165148 5 <rdar://problem/29421771> 6 7 Reviewed by Daniel Bates. 8 9 Update existing test to reflect behavior change. 10 11 * fast/dom/HTMLAnchorElement/anchor-download-synthetic-click-expected.txt: 12 * fast/dom/HTMLAnchorElement/anchor-download-synthetic-click.html: 13 1 14 2016-11-29 Eric Carlson <eric.carlson@apple.com> 2 15 -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-download-synthetic-click-expected.txt
r206659 r209091 1 CONSOLE MESSAGE: line 22: Non user-triggered activations of anchors that have a download attribute are ignored. 2 Test that synthetic clicks on an anchor with a download attribute are ignored. 1 Download started. 2 Downloading URL with suggested filename "foo.pdf" 3 Download completed. 4 Test that synthetic clicks on an anchor with a download attribute are not ignored. 3 5 4 This test passes if you do not see any 'Download started' message above.6 This test passes if you see a 'Download started' message above and if the suggested filename is foo.pdf. 5 7 6 8 Blob URL -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-download-synthetic-click.html
r206356 r209091 10 10 </head> 11 11 <body> 12 <p>Test that synthetic clicks on an anchor with a download attribute are ignored.</p>13 <p> This test passes if you do not see any 'Download started' message above.</p>14 <a id="blob-url" download >Blob URL</a>12 <p>Test that synthetic clicks on an anchor with a download attribute are not ignored.</p> 13 <p> This test passes if you see a 'Download started' message above and if the suggested filename is foo.pdf.</p> 14 <a id="blob-url" download="foo.pdf">Blob URL</a> 15 15 <script> 16 16 function runTest() -
trunk/Source/WebCore/ChangeLog
r209088 r209091 1 2016-11-29 Chris Dumez <cdumez@apple.com> 2 3 Can't download move.simple.com direct deposit transition PDF: Non user-triggered activations of anchors that have a download attribute are ignored 4 https://bugs.webkit.org/show_bug.cgi?id=165148 5 <rdar://problem/29421771> 6 7 Reviewed by Daniel Bates. 8 9 We were ignoring non user-triggered activations of anchors that have a 10 download attribute which is stricter than Chrome and Firefox and breaks 11 downloads on move.simple.com. This patch relaxes our policy to allow 12 simulated clicks on such links, similarly to other browsers. 13 14 Web authors can anyway already trigger downloads using script by setting 15 window.location to a specific URL and serving to right HTTP headers to 16 trigger a download. 17 18 Note that our previous behavior matches the current version of the 19 specification so I also filed a bug against the HTML specification to 20 see if we can get it changed to match the behavior of browsers: 21 - https://github.com/whatwg/html/issues/2116 22 23 No new tests, updated existing test. 24 25 * html/HTMLAnchorElement.cpp: 26 (WebCore::HTMLAnchorElement::handleClick): 27 1 28 2016-11-29 Andy Estes <aestes@apple.com> 2 29 -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r208985 r209091 384 384 else if (hasAttributeWithoutSynchronization(downloadAttr)) 385 385 document().addConsoleMessage(MessageSource::Security, MessageLevel::Warning, "The download attribute on anchor was ignored because its href URL has a different security origin."); 386 // If the a element has a download attribute and the algorithm is not triggered by user activation387 // then abort these steps.388 // https://html.spec.whatwg.org/#the-a-element:triggered-by-user-activation389 if (!downloadAttribute.isNull() && !event.isTrusted() && !ScriptController::processingUserGesture()) {390 // The specification says to throw an InvalidAccessError but other browsers do not.391 document().addConsoleMessage(MessageSource::Security, MessageLevel::Warning, "Non user-triggered activations of anchors that have a download attribute are ignored.");392 return;393 }394 386 } 395 387 #endif
Note: See TracChangeset
for help on using the changeset viewer.