2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
3 <?xml-stylesheet href=
"chrome://mochikit/content/tests/SimpleTest/test.css" type=
"text/css"?>
5 https://bugzilla.mozilla.org/show_bug.cgi?id=378518
7 <window title=
"Mozilla Bug 378518"
8 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
10 <script type=
"application/javascript"
11 src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
13 <bindings xmlns=
"http://www.mozilla.org/xbl"
14 xmlns:
xul=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
16 <binding id=
"mybinding" extends=
"xul:checkbox">
23 <!-- test results are displayed in the html:body -->
24 <body xmlns=
"http://www.w3.org/1999/xhtml">
25 <a href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=378518"
26 target=
"_blank">Mozilla Bug
378518</a>
29 <!-- The elements we're testing with -->
30 <command id=
"myBoxCommand" oncommand=
"myBoxClicked = true;"/>
31 <command id=
"myCheckBoxCommand" oncommand=
"myCheckBoxClicked = true;"/>
32 <command id=
"myExtendedBoxCommand" oncommand=
"myExtendedBoxClicked = true;"/>
34 <box id=
"myBox" command=
"myBoxCommand">
38 <checkbox id=
"myCheckBox" command=
"myCheckBoxCommand" label=
"myCheckBox"/>
40 <box id=
"myExtendedBox" command=
"myExtendedBoxCommand"
41 style=
"-moz-binding:url(#mybinding)">
42 <label>myExtendedBox
</label>
45 <!-- test code goes here -->
46 <script type=
"application/javascript"> <![CDATA[
48 SimpleTest.expectAssertions(
1);
50 var myBoxClicked = false;
51 var myCheckBoxClicked = false;
52 var myExtendedBoxClicked = false;
54 function testClick(elemName) {
56 window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
57 .getInterface(Components.interfaces.nsIDOMWindowUtils);
59 var a = document.getElementById(elemName).getBoundingClientRect();
60 wu.sendMouseEvent('mousedown', a.left +
1, a.top +
1,
0,
1,
0);
61 wu.sendMouseEvent('mouseup', a.left +
1, a.top +
1,
0,
1,
0);
66 testClick('myCheckBox');
67 testClick('myExtendedBox');
68 ok(!myBoxClicked,
"Shouldn't fire");
69 ok(myCheckBoxClicked,
"Should fire");
70 ok(!myExtendedBoxClicked,
"Shouldn't fire");
74 /** Test for Bug
378518 **/
75 SimpleTest.waitForExplicitFinish();
77 addLoadEvent(function() {
78 setTimeout(doTest,
0);