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
86 lines
2.8 KiB
HTML
86 lines
2.8 KiB
HTML
<?xml version="1.0"?>
|
|
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
|
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
|
|
<!--
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=469613
|
|
-->
|
|
<window title="Mozilla Bug 469613"
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
|
|
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
|
<script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
|
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=469613">Mozilla Bug 469613</a>
|
|
|
|
<p id="display"></p>
|
|
<div id="content" style="display: none">
|
|
</div>
|
|
</body>
|
|
|
|
<vbox style="height: 100px; overflow: auto;" id="scrollbox">
|
|
<hbox style="min-height: 200px;"/>
|
|
</vbox>
|
|
|
|
<script class="testbody" type="application/javascript"><![CDATA[
|
|
|
|
/** Test for Bug 469613 **/
|
|
|
|
function doTest() {
|
|
let scrollbox = document.getElementById("scrollbox");
|
|
scrollbox.scrollTop = 0;
|
|
|
|
// Make sure that the "scroll focus" is inside the scrollbox by moving the
|
|
// mouse in the scrollbox.
|
|
synthesizeMouse(scrollbox, 6, 6, { type: "mousemove" });
|
|
synthesizeMouse(scrollbox, 8, 8, { type: "mousemove" });
|
|
|
|
// Now scroll 10px down.
|
|
synthesizeWheel(scrollbox, 10, 10, { deltaY: 10.0, deltaMode: WheelEvent.DOM_DELTA_PIXEL });
|
|
|
|
// Send a 0-delta scroll.
|
|
synthesizeWheel(scrollbox, 10, 10, { deltaY: 0.0, deltaMode: WheelEvent.DOM_DELTA_PIXEL });
|
|
|
|
setTimeout(function() {
|
|
// Check if the 10px were scrolled.
|
|
todo(false, "Starting a 0-delta scroll shouldn't cancel a pending async scroll is disabled, see bug 752786");
|
|
//is(scrollbox.scrollTop, 10, "Starting a 0-delta scroll shouldn't cancel a pending async scroll.");
|
|
|
|
// Second test
|
|
scrollbox.scrollTop = 20;
|
|
|
|
// Start an async scroll to 30.
|
|
synthesizeWheel(scrollbox, 10, 10, { deltaY: 10.0, deltaMode: WheelEvent.DOM_DELTA_PIXEL });
|
|
|
|
// Start a sync scroll to 30.
|
|
scrollbox.scrollTop = 30;
|
|
|
|
is(scrollbox.scrollTop, 30, "Setting scrollTop should have immediate effect, even if there was a pending async scroll to the same position.");
|
|
|
|
|
|
// Third test
|
|
scrollbox.scrollTop = 40;
|
|
|
|
// Start an async scroll to 50.
|
|
synthesizeWheel(scrollbox, 10, 10, { deltaY: 10.0, deltaMode: WheelEvent.DOM_DELTA_PIXEL });
|
|
|
|
// Cancel the async scroll.
|
|
scrollbox.scrollTop = 40;
|
|
|
|
// Send a 0-delta scroll.
|
|
synthesizeWheel(scrollbox, 10, 10, { deltaY: 0.0, deltaMode: WheelEvent.DOM_DELTA_PIXEL });
|
|
|
|
setTimeout(function() {
|
|
is(scrollbox.scrollTop, 40, "Canceling an async scroll should reset the point of reference for relative scrolls (mDestinationX/Y).");
|
|
|
|
SimpleTest.finish();
|
|
}, 0);
|
|
}, 0);
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
addLoadEvent(() => setTimeout(doTest, 0));
|
|
|
|
]]></script>
|
|
|
|
</window>
|