From d701c43862b6375e2b16812152b40e09fa8b637d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 28 Jul 2026 14:16:03 -0400 Subject: [PATCH] fx153: Restore autocomplete popup sizing from the anchor element Firefox now sizes autocomplete popups to their content (bug 2045828), so add the --panel-width calculation back instead of adjusting it. --- app/scripts/fetch_xulrunner | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/scripts/fetch_xulrunner b/app/scripts/fetch_xulrunner index 43993cb8df..12a349ca40 100755 --- a/app/scripts/fetch_xulrunner +++ b/app/scripts/fetch_xulrunner @@ -514,10 +514,12 @@ function modify_omni { overflow: var(--moz-text-control-overflow); }' >> chrome/toolkit/res/forms.css - # By default, an autocomplete popup's width is calculated based on the input that opened it. - # Allow an ancestor to designate itself as the width container instead. (For creator inputs.) - replace_line 'aElement.getBoundingClientRect\(\).width' \ - '(aElement.closest(".autocomplete-popup-width-container") || aElement).getBoundingClientRect().width' \ + # Size an autocomplete popup to the input that opened it, or to an ancestor that designates + # itself as the width container. Firefox sizes the popup to its content. (For creator inputs.) + replace_line '\/\/ invalidate\(\) depends on the width attribute' \ + 'let widthElement = aElement.closest(".autocomplete-popup-width-container") || aElement; + this.style.setProperty("--panel-width", Math.max(widthElement.getBoundingClientRect().width, 100) + "px"); + \/\/ invalidate() depends on the width attribute' \ chrome/toolkit/content/global/elements/autocomplete-popup.js zip -qr9XD omni.ja *