|
@@ -119,8 +119,10 @@ void HTMLAnchorElement::activation_behavior(Web::DOM::Event const& event)
|
|
|
// 4. Let userInvolvement be event's user navigation involvement.
|
|
|
auto user_involvement = user_navigation_involvement(event);
|
|
|
|
|
|
- // FIXME: 5. If the user has expressed a preference to download the hyperlink, then set userInvolvement to "browser UI".
|
|
|
+ // 5. If the user has expressed a preference to download the hyperlink, then set userInvolvement to "browser UI".
|
|
|
// NOTE: That is, if the user has expressed a specific preference for downloading, this no longer counts as merely "activation".
|
|
|
+ if (has_download_preference())
|
|
|
+ user_involvement = UserNavigationInvolvement::BrowserUI;
|
|
|
|
|
|
// FIXME: 6. If element has a download attribute, or if the user has expressed a preference to download the
|
|
|
// hyperlink, then download the hyperlink created by element with hyperlinkSuffix set to hyperlinkSuffix and
|
|
@@ -130,6 +132,11 @@ void HTMLAnchorElement::activation_behavior(Web::DOM::Event const& event)
|
|
|
follow_the_hyperlink(hyperlink_suffix, user_involvement);
|
|
|
}
|
|
|
|
|
|
+bool HTMLAnchorElement::has_download_preference() const
|
|
|
+{
|
|
|
+ return has_attribute(HTML::AttributeNames::download);
|
|
|
+}
|
|
|
+
|
|
|
// https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex
|
|
|
i32 HTMLAnchorElement::default_tab_index_value() const
|
|
|
{
|