From 271aab4b32e04ba59a883cfb2a93053a7b37288a Mon Sep 17 00:00:00 2001 From: Cosmin Sabou Date: Mon, 15 Apr 2024 21:11:48 +0300 Subject: [PATCH] Backed out 3 changesets (bug 1890718) for failing sevaral UI related bc tests. CLOSED TREE Backed out changeset 3d91014dfcef (bug 1890718) Backed out changeset 8c09e2028ad9 (bug 1890718) Backed out changeset ff91ebffa8ab (bug 1890718) --- browser/base/content/appmenu-viewcache.inc.xhtml | 38 ++++++++++----- .../customizableui/CustomizableWidgets.sys.mjs | 20 -------- .../customizableui/content/panelUI.inc.xhtml | 2 +- .../components/customizableui/content/panelUI.js | 57 ++-------------------- .../test/browser_ctrl_click_panel_opening.js | 2 +- 5 files changed, 32 insertions(+), 87 deletions(-) diff --git a/browser/base/content/appmenu-viewcache.inc.xhtml b/browser/base/content/appmenu-viewcache.inc.xhtml index 75a3228f194d..1ba6902892cc 100644 --- a/browser/base/content/appmenu-viewcache.inc.xhtml +++ b/browser/base/content/appmenu-viewcache.inc.xhtml @@ -3,11 +3,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. - + - - + diff --git a/browser/components/customizableui/CustomizableWidgets.sys.mjs b/browser/components/customizableui/CustomizableWidgets.sys.mjs index 6a8ae58045e3..895fa1ceab7e 100644 --- a/browser/components/customizableui/CustomizableWidgets.sys.mjs +++ b/browser/components/customizableui/CustomizableWidgets.sys.mjs @@ -99,21 +99,6 @@ export const CustomizableWidgets = [ case "unload": this.onWindowUnload(event); break; - case "command": { - let { target } = event; - let { PanelUI, PlacesCommandHook } = target.ownerGlobal; - if (target.id == "appMenuRecentlyClosedTabs") { - PanelUI.showSubView(this.recentlyClosedTabsPanel, target); - } else if (target.id == "appMenuRecentlyClosedWindows") { - PanelUI.showSubView(this.recentlyClosedWindowsPanel, target); - } else if (target.id == "appMenuSearchHistory") { - PlacesCommandHook.searchHistory(); - } else if (target.id == "PanelUI-historyMore") { - PlacesCommandHook.showPlacesOrganizer("History"); - lazy.CustomizableUI.hidePanelForNode(target); - } - break; - } default: throw new Error(`Unsupported event for '${this.id}'`); } @@ -168,7 +153,6 @@ export const CustomizableWidgets = [ // When the popup is hidden (thus the panelmultiview node as well), make // sure to stop listening to PlacesDatabase updates. panelview.panelMultiView.addEventListener("PanelMultiViewHidden", this); - panelview.addEventListener("command", this); window.addEventListener("unload", this); }, onViewHiding() { @@ -188,10 +172,6 @@ export const CustomizableWidgets = [ document, this.recentlyClosedWindowsPanel ).removeEventListener("ViewShowing", this); - lazy.PanelMultiView.getViewNode( - document, - this.viewId - ).removeEventListener("command", this); } panelMultiView.removeEventListener("PanelMultiViewHidden", this); }, diff --git a/browser/components/customizableui/content/panelUI.inc.xhtml b/browser/components/customizableui/content/panelUI.inc.xhtml index 7607f59ec4b7..168c6204a275 100644 --- a/browser/components/customizableui/content/panelUI.inc.xhtml +++ b/browser/components/customizableui/content/panelUI.inc.xhtml @@ -271,7 +271,7 @@ flip="slide" position="bottomright topright" noautofocus="true"> - diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js index afa8b582ad33..cb32085fd709 100644 --- a/browser/components/customizableui/content/panelUI.js +++ b/browser/components/customizableui/content/panelUI.js @@ -132,7 +132,6 @@ const PanelUI = { "ViewShowing", this._onHelpViewShow ); - this.mainView.addEventListener("command", this); this._eventListenersAdded = true; }, @@ -144,7 +143,6 @@ const PanelUI = { document, "PanelUI-helpView" ).removeEventListener("ViewShowing", this._onHelpViewShow); - this.mainView.removeEventListener("command", this); this._eventListenersAdded = false; }, @@ -301,54 +299,6 @@ const PanelUI = { case "activate": this.updateNotifications(); break; - case "command": - this.onCommand(aEvent); - break; - } - }, - - // Note that we listen for bubbling command events. In the case where the - // button that the user clicks has a command attribute, those events are - // redirected to the relevant command element, and we never see them in - // here. Bear this in mind if you want to write code that applies to - // all commands, for which this wouldn't work well. - onCommand(aEvent) { - let { target } = aEvent; - switch (target.id) { - case "appMenu-update-banner": - this._onBannerItemSelected(aEvent); - break; - case "appMenu-fxa-label2": - gSync.toggleAccountPanel(target, aEvent); - break; - case "appMenu-profiles-button": - gProfiles.updateView(target); - break; - case "appMenu-bookmarks-button": - BookmarkingUI.showSubView(target); - break; - case "appMenu-history-button": - this.showSubView("PanelUI-history", target); - break; - case "appMenu-passwords-button": - LoginHelper.openPasswordManager(window, { entryPoint: "mainmenu" }); - break; - case "appMenu-fullscreen-button2": - // Note that we're custom-handling the hiding of the panel to make - // sure it disappears before entering fullscreen. Otherwise it can - // end up moving around on the screen during the fullscreen transition. - target.closest("panel").hidePopup(); - setTimeout(() => BrowserCommands.fullScreen(), 0); - break; - case "appMenu-settings-button": - openPreferences(); - break; - case "appMenu-more-button2": - this.showMoreToolsPanel(target); - break; - case "appMenu-help-button2": - this.showSubView("PanelUI-helpView", target); - break; } }, @@ -890,7 +840,10 @@ const PanelUI = { get mainView() { if (!this._mainView) { - this._mainView = PanelMultiView.getViewNode(document, "appMenu-mainView"); + this._mainView = PanelMultiView.getViewNode( + document, + "appMenu-protonMainView" + ); } return this._mainView; }, @@ -899,7 +852,7 @@ const PanelUI = { if (!this._addonNotificationContainer) { this._addonNotificationContainer = PanelMultiView.getViewNode( document, - "appMenu-addon-banners" + "appMenu-proton-addon-banners" ); } diff --git a/browser/components/customizableui/test/browser_ctrl_click_panel_opening.js b/browser/components/customizableui/test/browser_ctrl_click_panel_opening.js index b6f9cd7a4324..9377c2895081 100644 --- a/browser/components/customizableui/test/browser_ctrl_click_panel_opening.js +++ b/browser/components/customizableui/test/browser_ctrl_click_panel_opening.js @@ -13,7 +13,7 @@ add_task(async function test_appMenu_mainView() { return; } - let mainViewID = "appMenu-mainView"; + let mainViewID = "appMenu-protonMainView"; const mainView = document.getElementById(mainViewID); let shownPromise = BrowserTestUtils.waitForEvent(mainView, "ViewShown"); -- 2.11.4.GIT