mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-08 04:09:03 +02:00
Mostly changing XUL attributes to CSS properties, though there are a few tricky ones: * test_offsets.xhtml expects the scroller to be full-width, while modern flexbox would honor width: 200px (so just remove it). * window_intrinsic_size.xhtml was relying on the div imposing a XUL min-size (the test is for SetSizeConstraints, bug 1447056). Use min-height instead as that's what modern flexbox reads. Confirmed that bug doesn't regress in any case. * object-fit-contain-png-001.xhtml has a float: left which had no effect on -moz-box, but which assert with modern layout[1]. In the future I think we could remove that assert but anyways, for now just keeping behavior. * image-size.xhtml has a couple uninvestigated sizing differences. They didn't seem problematic. * 579323-1-ref.html changes because the other file has a canvas with width=100 height=100 which imposes an aspect ratio (which XUL never honored). * window_largemenu.xhtml shows a regression, but this never worked on some platforms (at least Linux+Wayland) and nobody has noticed it in the browser area, so I suspect we're fine. [1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137 Differential Revision: https://phabricator.services.mozilla.com/D169084
132 lines
4.7 KiB
HTML
132 lines
4.7 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"?>
|
|
|
|
<window title="Nested Context Menu Tests"
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
|
|
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
|
<script type="application/javascript" src="popup_shared.js"></script>
|
|
|
|
<menupopup id="outercontext">
|
|
<menuitem label="Context One"/>
|
|
<menu id="outercontextmenu" label="Sub">
|
|
<menupopup id="innercontext">
|
|
<menuitem id="innercontextmenu" label="Sub Context One"/>
|
|
</menupopup>
|
|
</menu>
|
|
</menupopup>
|
|
|
|
<menupopup id="outermain">
|
|
<menuitem label="One"/>
|
|
<menu id="outermenu" label="Sub">
|
|
<menupopup id="innermain">
|
|
<menuitem id="innermenu" label="Sub One" context="outercontext"/>
|
|
</menupopup>
|
|
</menu>
|
|
</menupopup>
|
|
|
|
<button label="Check"/>
|
|
|
|
<vbox id="popuparea" popup="outermain" style="width: 20px; height: 20px"/>
|
|
|
|
<script type="application/javascript">
|
|
<![CDATA[
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
var popupTests = [
|
|
{
|
|
testname: "open outer popup",
|
|
events: [ "popupshowing outermain", "popupshown outermain" ],
|
|
test: () => synthesizeMouse($("popuparea"), 4, 4, {}),
|
|
result (testname) {
|
|
is($("outermain").triggerNode, $("popuparea"), testname);
|
|
}
|
|
},
|
|
{
|
|
testname: "open inner popup",
|
|
events: [ "DOMMenuItemActive outermenu", "popupshowing innermain", "popupshown innermain" ],
|
|
test () {
|
|
synthesizeMouse($("outermenu"), 4, 4, { type: "mousemove" });
|
|
synthesizeMouse($("outermenu"), 2, 2, { type: "mousemove" });
|
|
},
|
|
result (testname) {
|
|
is($("outermain").triggerNode, $("popuparea"), testname + " outer");
|
|
is($("innermain").triggerNode, $("popuparea"), testname + " inner");
|
|
is($("outercontext").triggerNode, null, testname + " outer context");
|
|
}
|
|
},
|
|
{
|
|
testname: "open outer context",
|
|
condition() { return (!navigator.platform.includes("Mac")); },
|
|
events: [ "popupshowing outercontext", "popupshown outercontext" ],
|
|
test: () => synthesizeMouse($("innermenu"), 4, 4, { type: "contextmenu", button: 2 }),
|
|
result (testname) {
|
|
is($("outermain").triggerNode, $("popuparea"), testname + " outer");
|
|
is($("innermain").triggerNode, $("popuparea"), testname + " inner");
|
|
is($("outercontext").triggerNode, $("innermenu"), testname + " outer context");
|
|
}
|
|
},
|
|
{
|
|
testname: "open inner context",
|
|
condition() { return (!navigator.platform.includes("Mac")); },
|
|
events: [ "DOMMenuItemActive outercontextmenu", "popupshowing innercontext", "popupshown innercontext" ],
|
|
test () {
|
|
synthesizeMouse($("outercontextmenu"), 4, 4, { type: "mousemove" });
|
|
setTimeout(function() {
|
|
synthesizeMouse($("outercontextmenu"), 2, 2, { type: "mousemove" });
|
|
}, 1000);
|
|
},
|
|
result (testname) {
|
|
is($("outermain").triggerNode, $("popuparea"), testname + " outer");
|
|
is($("innermain").triggerNode, $("popuparea"), testname + " inner");
|
|
is($("outercontext").triggerNode, $("innermenu"), testname + " outer context");
|
|
is($("innercontext").triggerNode, $("innermenu"), testname + " inner context");
|
|
}
|
|
},
|
|
{
|
|
testname: "close context",
|
|
condition() { return (!navigator.platform.includes("Mac")); },
|
|
events: [ "popuphiding innercontext", "popuphidden innercontext",
|
|
"popuphiding outercontext", "popuphidden outercontext",
|
|
"DOMMenuInactive innercontext",
|
|
"DOMMenuItemInactive outercontextmenu",
|
|
"DOMMenuInactive outercontext" ],
|
|
test: () => $("outercontext").hidePopup(),
|
|
result (testname) {
|
|
is($("outermain").triggerNode, $("popuparea"), testname + " outer");
|
|
is($("innermain").triggerNode, $("popuparea"), testname + " inner");
|
|
is($("outercontext").triggerNode, null, testname + " outer context");
|
|
is($("innercontext").triggerNode, null, testname + " inner context");
|
|
}
|
|
},
|
|
{
|
|
testname: "hide menus",
|
|
events: [ "popuphiding innermain", "popuphidden innermain",
|
|
"popuphiding outermain", "popuphidden outermain",
|
|
"DOMMenuInactive innermain",
|
|
"DOMMenuItemInactive outermenu",
|
|
"DOMMenuInactive outermain" ],
|
|
|
|
test: () => $("outermain").hidePopup(),
|
|
result (testname) {
|
|
is($("outermain").triggerNode, null, testname + " outer");
|
|
is($("innermain").triggerNode, null, testname + " inner");
|
|
is($("outercontext").triggerNode, null, testname + " outer context");
|
|
is($("innercontext").triggerNode, null, testname + " inner context");
|
|
}
|
|
}
|
|
];
|
|
|
|
SimpleTest.waitForFocus(function runTest() {
|
|
return startPopupTests(popupTests);
|
|
});
|
|
|
|
]]>
|
|
</script>
|
|
|
|
<body xmlns="http://www.w3.org/1999/xhtml"><p id="display"/></body>
|
|
|
|
</window>
|