commit 652113d61d031e711275cb0fd1cc8055cfe2a41e
parent 2ebab47fa7e45a52394f763b77ed0e7c58c59fff
Author: Simon Farre <sfarre@mozilla.com>
Date: Mon, 1 Dec 2025 08:42:03 +0000
Bug 2003176 - Address redundant IPC r=dom-core,jjaschke
Doing NotifyUserGestureActivation twice is unnecessary.
Differential Revision: https://phabricator.services.mozilla.com/D274516
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp
@@ -18184,7 +18184,8 @@ void Document::NotifyUserGestureActivation(
// 3. "...windows with the active window of each of document's ancestor
// navigables."
- for (WindowContext* wc = currentWC; wc; wc = wc->GetParentWindowContext()) {
+ for (WindowContext* wc = currentWC->GetParentWindowContext(); wc;
+ wc = wc->GetParentWindowContext()) {
wc->NotifyUserGestureActivation(aModifiers);
}
@@ -18193,7 +18194,8 @@ void Document::NotifyUserGestureActivation(
// document's origin is same origin with document's origin"
currentBC->PreOrderWalk([&](BrowsingContext* bc) {
WindowContext* wc = bc->GetCurrentWindowContext();
- if (!wc) {
+ // currentWC has already been notified
+ if (!wc || wc == currentWC) {
return;
}