From 829794ed6929670753989c3d2b66fbfa9d3c4cf7 Mon Sep 17 00:00:00 2001 From: Cristian Tuns Date: Sat, 24 Jun 2023 15:11:16 -0400 Subject: [PATCH] Backed out changeset 31d5ffaf0b16 (bug 1836633) for causing bc failures in browser_translations_panel_always_translate_language.js CLOSED TREE --- browser/base/content/main-popupset.inc.xhtml | 24 ----------------- .../content/translationsPanel.inc.xhtml | 27 ++++++++++++++++++- .../translations/content/translationsPanel.js | 12 ++++----- browser/themes/shared/translations/panel.css | 2 +- 4 files changed, 32 insertions(+), 33 deletions(-) diff --git a/browser/base/content/main-popupset.inc.xhtml b/browser/base/content/main-popupset.inc.xhtml index fb0df4303e8d..71a3dffd8af2 100644 --- a/browser/base/content/main-popupset.inc.xhtml +++ b/browser/base/content/main-popupset.inc.xhtml @@ -636,28 +636,4 @@ class="unified-extensions-context-menu-report-extension" oncommand="gUnifiedExtensions.reportExtension(this.parentElement)" /> - - - - - - - - diff --git a/browser/components/translations/content/translationsPanel.inc.xhtml b/browser/components/translations/content/translationsPanel.inc.xhtml index 979a099d8b8c..051b1fe28bdb 100644 --- a/browser/components/translations/content/translationsPanel.inc.xhtml +++ b/browser/components/translations/content/translationsPanel.inc.xhtml @@ -23,7 +23,32 @@ + oncommand="TranslationsPanel.openSettingsPopup(this)"> + + + + + + + + + diff --git a/browser/components/translations/content/translationsPanel.js b/browser/components/translations/content/translationsPanel.js index 90e130d1c0d4..fdd467d49e4e 100644 --- a/browser/components/translations/content/translationsPanel.js +++ b/browser/components/translations/content/translationsPanel.js @@ -727,7 +727,7 @@ var TranslationsPanel = new (class { */ async #updateSettingsMenuSiteCheckboxStates() { const { panel } = this.elements; - const neverTranslateSiteMenuItems = panel.ownerDocument.querySelectorAll( + const neverTranslateSiteMenuItems = panel.querySelectorAll( ".never-translate-site-menuitem" ); const neverTranslateSite = @@ -747,10 +747,10 @@ var TranslationsPanel = new (class { const { panel } = this.elements; - const alwaysTranslateMenuItems = panel.ownerDocument.querySelectorAll( + const alwaysTranslateMenuItems = panel.querySelectorAll( ".always-translate-language-menuitem" ); - const neverTranslateMenuItems = panel.ownerDocument.querySelectorAll( + const neverTranslateMenuItems = panel.querySelectorAll( ".never-translate-language-menuitem" ); @@ -956,10 +956,8 @@ var TranslationsPanel = new (class { openSettingsPopup(button) { this.#updateSettingsMenuLanguageCheckboxStates(); this.#updateSettingsMenuSiteCheckboxStates(); - const popup = button.ownerDocument.getElementById( - "translations-panel-settings-menupopup" - ); - popup.openPopup(button, "after_end"); + const popup = button.querySelector("menupopup"); + popup.openPopup(button); } /** diff --git a/browser/themes/shared/translations/panel.css b/browser/themes/shared/translations/panel.css index d607161aae4d..d8b33b1872e3 100644 --- a/browser/themes/shared/translations/panel.css +++ b/browser/themes/shared/translations/panel.css @@ -17,7 +17,7 @@ padding-bottom: 0; } -#translations-panel-settings > image { +image.translations-panel-gear-icon { /* Override the panel-info-button with a gear icon. */ list-style-image: url(chrome://global/skin/icons/settings.svg); }