commit 39952d088a8c1a636a93469db97c52d4cdb1eeda
parent bd3c9412e69e4857935308cca9c905ebc24e2f9f
Author: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Wed, 1 Oct 2025 14:49:03 +0000
Bug 1964065, ConsumeTransientUserGestureActivation should return early if the window context isn't current, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D267006
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/docshell/base/WindowContext.cpp b/docshell/base/WindowContext.cpp
@@ -625,9 +625,10 @@ bool WindowContext::HasValidTransientUserGestureActivation() {
// https://html.spec.whatwg.org/#consume-user-activation
bool WindowContext::ConsumeTransientUserGestureActivation() {
MOZ_ASSERT(IsInProcess());
- MOZ_ASSERT(IsCurrent());
-
// 1. If W's navigable is null, then return.
+ if (!IsCurrent()) {
+ return false;
+ }
if (!HasValidTransientUserGestureActivation()) {
return false;