From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- devtools/client/performance-new/popup/logic.sys.mjs | 15 ++++++++------- devtools/client/performance-new/popup/menu-button.sys.mjs | 8 +++----- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'devtools/client/performance-new/popup') diff --git a/devtools/client/performance-new/popup/logic.sys.mjs b/devtools/client/performance-new/popup/logic.sys.mjs index 174163d54b..9c10987ec1 100644 --- a/devtools/client/performance-new/popup/logic.sys.mjs +++ b/devtools/client/performance-new/popup/logic.sys.mjs @@ -36,6 +36,13 @@ const lazy = createLazyLoaders({ */ function selectElementsInPanelview(panelview) { const document = panelview.ownerDocument; + + // Forcefully cast the window to the type Window + /** @type {any} */ + const windowAny = document.defaultView; + /** @type {Window} */ + const window = windowAny; + /** * Get an element or throw an error if it's not found. This is more friendly * for TypeScript. @@ -54,16 +61,10 @@ function selectElementsInPanelview(panelview) { return element; } - // Forcefully cast the window to the type ChromeWindow. - /** @type {any} */ - const chromeWindowAny = document.defaultView; - /** @type {ChromeWindow} */ - const chromeWindow = chromeWindowAny; - return { document, panelview, - window: chromeWindow, + window, inactive: getElementById("PanelUI-profiler-inactive"), active: getElementById("PanelUI-profiler-active"), presetDescription: getElementById("PanelUI-profiler-content-description"), diff --git a/devtools/client/performance-new/popup/menu-button.sys.mjs b/devtools/client/performance-new/popup/menu-button.sys.mjs index f1aee09af4..3dfffb4098 100644 --- a/devtools/client/performance-new/popup/menu-button.sys.mjs +++ b/devtools/client/performance-new/popup/menu-button.sys.mjs @@ -32,10 +32,9 @@ const WIDGET_ID = "profiler-button"; /** * Add the profiler button to the navbar. * - * @param {ChromeDocument} document The browser's document. * @return {void} */ -function addToNavbar(document) { +function addToNavbar() { const { CustomizableUI } = lazy.CustomizableUI(); CustomizableUI.addWidgetToArea(WIDGET_ID, CustomizableUI.AREA_NAVBAR); @@ -173,7 +172,7 @@ function initialize(toggleProfilerKeyShortcuts) { /** * @type {(event: { target: ChromeHTMLElement | XULElement }) => void} */ - onViewHiding(event) { + onViewHiding() { // Clean-up the view. This removes all of the event listeners. for (const fn of panelState.cleanup) { fn(); @@ -292,8 +291,7 @@ function initialize(toggleProfilerKeyShortcuts) { }); }, - // @ts-ignore - Bug 1674368 - onCommand: event => { + onCommand: () => { if (Services.profiler.IsPaused()) { // A profile is already being captured, ignore this event. return; -- cgit v1.2.3