|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
|
4 |
|
5 <window title="Menu Destruction Test" |
|
6 onload="setTimeout(runTests, 0);" |
|
7 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
8 |
|
9 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
11 |
|
12 <menu id="menu"> |
|
13 <menupopup onpopupshown="this.firstChild.open = true" onpopuphidden="if (event.target == this) done()"> |
|
14 <menu id="submenu" label="One"> |
|
15 <menupopup onpopupshown="submenuOpened();"> |
|
16 <menuitem label="Two"/> |
|
17 </menupopup> |
|
18 </menu> |
|
19 </menupopup> |
|
20 </menu> |
|
21 |
|
22 <script class="testbody" type="application/javascript"> |
|
23 <![CDATA[ |
|
24 |
|
25 SimpleTest.waitForExplicitFinish(); |
|
26 |
|
27 function runTests() |
|
28 { |
|
29 $("menu").open = true; |
|
30 } |
|
31 |
|
32 function submenuOpened() |
|
33 { |
|
34 var submenu = $("submenu") |
|
35 is(submenu.getAttribute('_moz-menuactive'), "true", "menu highlighted"); |
|
36 submenu.hidden = true; |
|
37 $("menu").open = false; |
|
38 } |
|
39 |
|
40 function done() |
|
41 { |
|
42 ok(!$("submenu").hasAttribute('_moz-menuactive'), "menu unhighlighted"); |
|
43 SimpleTest.finish(); |
|
44 } |
|
45 |
|
46 ]]> |
|
47 </script> |
|
48 |
|
49 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
50 <p id="display"> |
|
51 </p> |
|
52 <div id="content" style="display: none"> |
|
53 </div> |
|
54 <pre id="test"> |
|
55 </pre> |
|
56 </body> |
|
57 |
|
58 </window> |