diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /browser/actors/ContextMenuChild.sys.mjs | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/actors/ContextMenuChild.sys.mjs')
-rw-r--r-- | browser/actors/ContextMenuChild.sys.mjs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/browser/actors/ContextMenuChild.sys.mjs b/browser/actors/ContextMenuChild.sys.mjs index 5ecbcb22e9..2b98bea65e 100644 --- a/browser/actors/ContextMenuChild.sys.mjs +++ b/browser/actors/ContextMenuChild.sys.mjs @@ -535,6 +535,23 @@ export class ContextMenuChild extends JSWindowActorChild { } let doc = aEvent.composedTarget.ownerDocument; + if (!doc && Cu.isInAutomation) { + // doc has been observed to be null for many years, causing intermittent + // test failures all over the place (bug 1478596). The rate of failures + // is too low to debug locally, but frequent enough to be a nuisance. + // TODO bug 1478596: use these diagnostic logs to resolve the bug. + dump( + `doc is unexpectedly null (bug 1478596), composedTarget=${aEvent.composedTarget}\n` + ); + // A potential fix is to fall back to aEvent.target.ownerDocument, per + // https://bugzilla.mozilla.org/show_bug.cgi?id=1478596#c1 + // Let's print potentially viable alternatives to see what we should use. + for (let k of ["target", "originalTarget", "explicitOriginalTarget"]) { + dump( + ` Alternative: ${k}=${aEvent[k]} and its doc=${aEvent[k]?.ownerDocument}\n` + ); + } + } let { mozDocumentURIIfNotForErrorPages: docLocation, characterSet: charSet, |