commit aae8c979bbbda0f4ec09324efd9dd984b53672a1
parent c4ddebb9f6f746852a588c8e93a2874449f7b84b
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Wed, 29 Oct 2025 13:12:59 +0000
Bug 1996868 - Remove event listener from the right target. r=smaug
This code adds the listener to the contentWindow but tries to remove it
from the contentDocument, leaking it.
Differential Revision: https://phabricator.services.mozilla.com/D270478
Diffstat:
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/toolkit/modules/DateTimePickerPanel.sys.mjs b/toolkit/modules/DateTimePickerPanel.sys.mjs
@@ -76,10 +76,7 @@ export var DateTimePickerPanel = class {
this.pickerState = {};
this.type = undefined;
this.dateTimePopupFrame.removeEventListener("load", this, true);
- this.dateTimePopupFrame.contentDocument.removeEventListener(
- "message",
- this
- );
+ this.dateTimePopupFrame.contentWindow.removeEventListener("message", this);
this.dateTimePopupFrame.setAttribute("src", "");
this.element.hidePopup();
}