Bug 1966349 - Make sure NavigateEvent is initialized correctly. r=jjaschke

Make sure the  properties downloadRequest and userInitiated get their
correct values.

Differential Revision: https://phabricator.services.mozilla.com/D249243
This commit is contained in:
Andreas Farre
2025-05-14 13:25:28 +00:00
committed by afarre@mozilla.com
parent 86fbf126b4
commit b81eda9a8a
2 changed files with 3 additions and 2 deletions

View File

@@ -12979,6 +12979,7 @@ nsresult nsDocShell::OnLinkClick(
loadState->SetTextDirectiveUserActivation(
ownerDoc->ConsumeTextDirectiveUserActivation() ||
hasValidUserGestureActivation);
loadState->SetUserNavigationInvolvement(aUserInvolvement);
nsCOMPtr<nsIRunnable> ev = new OnLinkClickEvent(
this, aContent, loadState, noOpenerImplied, aTriggeringPrincipal);

View File

@@ -526,7 +526,7 @@ bool Navigation::FireTraverseNavigateEvent(
/* aSourceElement */ nullptr,
/* aFormDataEntryList*/ Nothing(),
/* aClassicHistoryAPIState */ nullptr,
/* aDownloadRequestFilename */ u""_ns);
/* aDownloadRequestFilename */ VoidString());
}
// https://html.spec.whatwg.org/#fire-a-push/replace/reload-navigate-event
@@ -552,7 +552,7 @@ bool Navigation::FirePushReplaceReloadNavigateEvent(
aCx, aNavigationType, destination,
aUserInvolvement.valueOr(UserNavigationInvolvement::None), aSourceElement,
aFormDataEntryList, aClassicHistoryAPIState,
/* aDownloadRequestFilename */ u""_ns);
/* aDownloadRequestFilename */ VoidString());
}
// https://html.spec.whatwg.org/#fire-a-download-request-navigate-event