Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android' OR os == 'mac' && debug OR os == 'mac' && os_version == '14.70' && processor == 'x86_64' && opt
- Manifest: dom/tests/mochitest/general/chrome.toml
<?xml version="1.0"?>
<?xml-stylesheet href="test_offsets.css" type="text/css"?>
<!--
XUL Tests for client/scroll properties
-->
<window title="Test Offset/Client/Scroll Properties" width="500" height="600"
style="margin: 1px !important"
<script type="text/javascript" src="test_offsets.js"/>
<vbox id="testelements" style="margin: 0; padding: 0; border: 0;">
<vbox id="vbox" style="margin: 5px 0 0 2px;">
<vbox id="noscroll" align="start">
<button id="button1" label="Button One" style="margin: 0px; padding: 0; border: 0;"/>
<button id="button2" label="Button Two" style="width: 140px; height: 120px;"/>
</vbox>
<hbox align="start">
<vbox id="scrollbox" style="overflow: scroll; padding: 2px; margin: 3px; border: 4px solid green; max-width: 66px; max-height: 56px">
<label value="One" style="margin: 0"/>
<label id="scrollchild" value="Two"/>
<label value="Three"/>
<label id="lastline" value="This fourth label is much longer than the others"
style="margin: 0; padding: 0; border: 0;"/>
</vbox>
<vbox id="scrollbox-test">
<scrollbar orient="vertical" style="border: 0; padding: 0;"/>
</vbox>
</hbox>
</vbox>
<!-- wrap svg in a div so that it can take its intrinsic width -->
<div>
<svg:rect id="svgrect" x="3" y="5" width="45" height="20" fill="red"/>
</svg:svg>
</div>
</vbox>
<button id="outermenu" type="menu" label="Menu">
<menupopup id="outerpopup"
style="margin-left: 5px; padding-left: 3px; padding: 0;"
onpopupshown="this.firstChild.open = true"
onpopuphidden="if (event.target == this) SimpleTest.finish();">
<menu id="innermenu" label="Open"
style="margin: 0; padding: 0; border: 2px black solid; -moz-appearance: none;">
<menupopup style="margin: 0; padding: 0; border: 1px black solid; -moz-appearance: none;"
onpopupshown="testElements('outermenu', doneTests)">
<menuitem label="Document"/>
<menuitem id="innermenuitem" style="margin: 2px; padding: 3px;" label="Page"/>
</menupopup>
</menu>
<menuitem id="outermenuitem" label="Close"/>
</menupopup>
</button>
<!-- test results are displayed in the html:body -->
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
var gTestSet = "box";
var whichpopup = "outer";
SimpleTest.waitForExplicitFinish();
function startTests()
{
testElements('testelements', doneTests);
}
function doneTests()
{
if (gTestSet == "box") {
gTestSet = "popup";
// only test this on Mac for now
if (navigator.platform.includes("Mac")) {
checkScrollState($("outerpopup"), 0, 0, 0, 0, "popup before open");
checkClientState($("outerpopup"), 0, 0, 0, 0, "popup before open");
}
$("outermenu").open = true;
}
else {
$("outermenu").open = false;
}
}
SimpleTest.waitForFocus(startTests);
]]>
</script>
</window>