[tbb-commits] [tor-browser] 41/74: Bug 41371: Temporary hack to fix language selector popup position

gitolite role git at cupani.torproject.org
Thu Oct 27 21:21:46 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-102.4.0esr-12.0-2
in repository tor-browser.

commit bfb178e26d582712a16f7777d501ca92b24187ab
Author: Henry Wilkes <henry at torproject.org>
AuthorDate: Thu Oct 20 18:19:28 2022 +0100

    Bug 41371: Temporary hack to fix language selector popup position
---
 browser/components/preferences/main.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
index 42cc72f6f91c..9818a349b3f4 100644
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -1010,6 +1010,23 @@ var gMainPane = {
       gMainPane.onPrimaryBrowserLanguageMenuChange(event);
     });
 
+    // Temporary hack to cause the menu popup to resize itself just after being
+    // shown. See tor-browser#41371
+    // We get ~one frame of a potentially badly sized popup, and then the popup
+    // should re-adjust to the new size.
+    // TODO: Remove with firefox 115 since this is fixed properly in
+    // mozilla-central 107.
+    menulist.addEventListener("popupshown", () => {
+      const popupBox = menulist.menupopup;
+      // We change a layout parameter and then force a relayout. We choose
+      // "min-height: 0" since we expect this won't change the displayed result
+      // but is enough to force the relayout.
+      const minHeight = popupBox.style.minHeight;
+      popupBox.style.minHeight = 0;
+      popupBox.getBoundingClientRect();
+      popupBox.style.minHeight = minHeight;
+    });
+
     gMainPane.updatePrimaryBrowserLanguageUI(Services.locale.appLocaleAsBCP47);
   },
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list