summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/menupopup.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /toolkit/content/widgets/menupopup.js
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/content/widgets/menupopup.js')
-rw-r--r--toolkit/content/widgets/menupopup.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/toolkit/content/widgets/menupopup.js b/toolkit/content/widgets/menupopup.js
index 31801d6a33..c7448d4f05 100644
--- a/toolkit/content/widgets/menupopup.js
+++ b/toolkit/content/widgets/menupopup.js
@@ -11,16 +11,12 @@
"resource://gre/modules/AppConstants.sys.mjs"
);
- // For the non-native context menu styling, we need to know if we need
- // a gutter for checkboxes. To do this, check whether there are any
- // radio/checkbox type menuitems in a menupopup when showing it. We use a
- // system bubbling event listener to ensure we run *after* the "normal"
- // popupshowing listeners, so (visibility) changes they make to their items
- // take effect first, before we check for checkable menuitems.
- Services.els.addSystemEventListener(
- document,
+ document.addEventListener(
"popupshowing",
function (e) {
+ // For the non-native context menu styling, we need to know if we need
+ // a gutter for checkboxes. To do this, check whether there are any
+ // radio/checkbox type menuitems in a menupopup when showing it.
if (e.target.nodeName == "menupopup") {
let haveCheckableChild = e.target.querySelector(
`:scope > menuitem:not([hidden]):is([type=checkbox],[type=radio]${
@@ -33,7 +29,10 @@
e.target.toggleAttribute("needsgutter", haveCheckableChild);
}
},
- false
+ // we use a system bubbling event listener to ensure we run *after* the
+ // "normal" popupshowing listeners, so (visibility) changes they make to
+ // their items take effect first, before we check for checkable menuitems.
+ { mozSystemGroup: true }
);
class MozMenuPopup extends MozElements.MozElementMixin(XULPopupElement) {
@@ -74,13 +73,13 @@
initShadowDOM() {
// Retarget events from shadow DOM arrowscrollbox to the host.
- this.scrollBox.addEventListener("scroll", ev =>
+ this.scrollBox.addEventListener("scroll", () =>
this.dispatchEvent(new Event("scroll"))
);
- this.scrollBox.addEventListener("overflow", ev =>
+ this.scrollBox.addEventListener("overflow", () =>
this.dispatchEvent(new Event("overflow"))
);
- this.scrollBox.addEventListener("underflow", ev =>
+ this.scrollBox.addEventListener("underflow", () =>
this.dispatchEvent(new Event("underflow"))
);
}