Bug 190408 - Anchor target should be ignored on activation when the download attribute is set
Summary: Anchor target should be ignored on activation when the download attribute is set
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-09 12:27 PDT by Chris Dumez
Modified: 2018-10-09 16:22 PDT (History)
12 users (show)

See Also:


Attachments
Patch (17.98 KB, patch)
2018-10-09 12:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (22.46 KB, patch)
2018-10-09 13:07 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (23.95 KB, patch)
2018-10-09 14:14 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-10-09 12:27:14 PDT
Anchor target should be ignored on activation when the download attribute is set:
- https://html.spec.whatwg.org/#the-a-element:downloading-hyperlinks-2

When the download attribute is set, we should use the "download the hyperlink" algorithm [1] instead of the "follow the hyperlink" [2] algorithm.
Note that the "download the hyperlink" triggers a download and ignores the target attribute entirely.

This is important as an anchor element with target=_blank and the download attribute set may fail because of Safari's popup blocker if we do not disregard the anchor target.

[1] https://html.spec.whatwg.org/#downloading-hyperlinks
[2] https://html.spec.whatwg.org/#following-hyperlinks-2
Comment 1 Chris Dumez 2018-10-09 12:35:02 PDT
Created attachment 351902 [details]
Patch
Comment 2 Chris Dumez 2018-10-09 13:07:56 PDT
Created attachment 351903 [details]
Patch
Comment 3 Chris Dumez 2018-10-09 14:14:52 PDT
Created attachment 351916 [details]
Patch
Comment 4 Geoffrey Garen 2018-10-09 15:54:06 PDT
Comment on attachment 351916 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2018-10-09 16:21:25 PDT
Comment on attachment 351916 [details]
Patch

Clearing flags on attachment: 351916

Committed r236987: <https://trac.webkit.org/changeset/236987>
Comment 6 WebKit Commit Bot 2018-10-09 16:21:27 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-10-09 16:22:29 PDT
<rdar://problem/45145107>