Files
tubestation/layout/reftests/invalidation/540247-1-ref.xhtml
Emilio Cobos Álvarez 4e6afc55ea 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
2023-03-14 12:22:11 +00:00

30 lines
854 B
HTML

<?xml version="1.0"?>
<window id="Test for bug 540247" title="Testcase" class="reftest-wait"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script><![CDATA[
document.addEventListener("MozReftestInvalidate", runtest, false);
function runtest() {
document.getElementById('b').style.minHeight = '100px';
var scrollbox = document.getElementById('s');
scrollbox.scrollTo(0, 1000);
document.documentElement.className = "";
}
]]>
</script>
<scrollbox id="s" style="height: 200px; overflow: scroll;">
<vbox>
<vbox style="min-height: 150px; min-width: 200px; background: red;" id="b"/>
<vbox style="min-height: 150px; min-width: 200px; background: green;"/>
<vbox style="min-height: 150px; min-width: 200px; background: blue;"/>
<label value="a"/>
</vbox>
</scrollbox>
</window>