From 8d5b4b05552d61fc0a9463a2faac6c889522b746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 14 Mar 2023 12:22:11 +0000 Subject: [PATCH] Bug 1822131 - Allow XUL elements to shrink-by-default. r=dholbert Bug 1821920 and bug 1821871 are instances of an interesting behavior change from bug 1820534. The default flex-basis of old XUL was auto instead of max-content, because of this code: https://searchfox.org/mozilla-central/rev/af78418c4b5f2c8721d1a06486cf4cf0b33e1e8d/layout/generic/nsFlexContainerFrame.cpp#1327 So stuff that used to wrap now no longer does, in an horizontal flex container, since xul.css prevents XUL elements from shrinking. Per the comment, a few tests relied on this, but I believe it should generally be safe to shrink the items. This only causes to shrink if they have an explicit width but no min-width (including min-width: auto). Some tests like test_mousescroll.xhtml hit this, because they have explicit sizes but min-width: auto ends up being 0 effectively, but I believe we should tweak those tests instead. Differential Revision: https://phabricator.services.mozilla.com/D172462 --- .../test/browser_hidden_widget_overflow.js | 2 +- dom/events/test/bug602962.xhtml | 2 +- .../tests/chrome/printpreview_helper.xhtml | 9 ++--- layout/generic/test/test_bug469613.xhtml | 2 +- .../reftests/invalidation/540247-1-ref.xhtml | 8 ++-- layout/reftests/invalidation/540247-1.xhtml | 8 ++-- layout/xul/test/test_splitter.xhtml | 2 +- .../tests/chrome/test_hiddenpaging.xhtml | 2 +- .../tests/chrome/test_mousescroll.xhtml | 40 +++++++++---------- toolkit/content/xul.css | 4 -- 10 files changed, 37 insertions(+), 42 deletions(-) diff --git a/browser/components/customizableui/test/browser_hidden_widget_overflow.js b/browser/components/customizableui/test/browser_hidden_widget_overflow.js index 665a8fa74b88c..5e0555e29a45c 100644 --- a/browser/components/customizableui/test/browser_hidden_widget_overflow.js +++ b/browser/components/customizableui/test/browser_hidden_widget_overflow.js @@ -49,7 +49,7 @@ add_setup(async function() { // of the hidden widget) get overflowed. for (let webExtID of [kWebExtensionButtonID1, kWebExtensionButtonID2]) { let webExtNode = CustomizableUI.getWidget(webExtID).forWindow(gWin).node; - webExtNode.style.width = "100px"; + webExtNode.style.minWidth = "100px"; } CustomizableUI.createWidget({ diff --git a/dom/events/test/bug602962.xhtml b/dom/events/test/bug602962.xhtml index 0d54b7ad5260b..43affd6b60017 100644 --- a/dom/events/test/bug602962.xhtml +++ b/dom/events/test/bug602962.xhtml @@ -3,6 +3,6 @@ - + diff --git a/layout/base/tests/chrome/printpreview_helper.xhtml b/layout/base/tests/chrome/printpreview_helper.xhtml index 15c56d83c81de..055f75c8f54b5 100644 --- a/layout/base/tests/chrome/printpreview_helper.xhtml +++ b/layout/base/tests/chrome/printpreview_helper.xhtml @@ -4,8 +4,8 @@ type="text/css"?> - - + +