mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
83
dom/xbl/test/test_bug378518.xul
Normal file
83
dom/xbl/test/test_bug378518.xul
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<?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=378518
|
||||
-->
|
||||
<window title="Mozilla Bug 378518"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="mybinding" extends="xul:checkbox">
|
||||
<content>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
||||
<!-- test results are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=378518"
|
||||
target="_blank">Mozilla Bug 378518</a>
|
||||
</body>
|
||||
|
||||
<!-- The elements we're testing with -->
|
||||
<command id="myBoxCommand" oncommand="myBoxClicked = true;"/>
|
||||
<command id="myCheckBoxCommand" oncommand="myCheckBoxClicked = true;"/>
|
||||
<command id="myExtendedBoxCommand" oncommand="myExtendedBoxClicked = true;"/>
|
||||
|
||||
<box id="myBox" command="myBoxCommand">
|
||||
<label>myBox</label>
|
||||
</box>
|
||||
|
||||
<checkbox id="myCheckBox" command="myCheckBoxCommand" label="myCheckBox"/>
|
||||
|
||||
<box id="myExtendedBox" command="myExtendedBoxCommand"
|
||||
style="-moz-binding:url(#mybinding)">
|
||||
<label>myExtendedBox</label>
|
||||
</box>
|
||||
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript"> <![CDATA[
|
||||
|
||||
SimpleTest.expectAssertions(1);
|
||||
|
||||
var myBoxClicked = false;
|
||||
var myCheckBoxClicked = false;
|
||||
var myExtendedBoxClicked = false;
|
||||
|
||||
function testClick(elemName) {
|
||||
var wu =
|
||||
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIDOMWindowUtils);
|
||||
|
||||
var a = document.getElementById(elemName).getBoundingClientRect();
|
||||
wu.sendMouseEvent('mousedown', a.left + 1, a.top + 1, 0, 1, 0);
|
||||
wu.sendMouseEvent('mouseup', a.left + 1, a.top + 1, 0, 1, 0);
|
||||
}
|
||||
|
||||
function doTest() {
|
||||
testClick('myBox');
|
||||
testClick('myCheckBox');
|
||||
testClick('myExtendedBox');
|
||||
ok(!myBoxClicked, "Shouldn't fire");
|
||||
ok(myCheckBoxClicked, "Should fire");
|
||||
ok(!myExtendedBoxClicked, "Shouldn't fire");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
/** Test for Bug 378518 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
setTimeout(doTest, 0);
|
||||
});
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
||||
Loading…
Add table
Add a link
Reference in a new issue