|
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 https://bugzilla.mozilla.org/show_bug.cgi?id=360220 |
|
6 --> |
|
7 <window title="Mozilla Bug 360220" |
|
8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
9 |
|
10 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
11 |
|
12 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=360220">Mozilla Bug 360220</a> |
|
14 <p id="display"></p> |
|
15 <div id="content" style="display: none"> |
|
16 |
|
17 </div> |
|
18 <pre id="test"> |
|
19 </pre> |
|
20 </body> |
|
21 |
|
22 <menulist id="menulist"> |
|
23 <menupopup> |
|
24 <menuitem id="firstItem" label="foo" selected="true"/> |
|
25 <menuitem id="secondItem" label="bar"/> |
|
26 </menupopup> |
|
27 </menulist> |
|
28 <script class="testbody" type="application/javascript"> |
|
29 <![CDATA[ |
|
30 |
|
31 /** Test for Bug 360220 **/ |
|
32 |
|
33 var menulist = document.getElementById("menulist"); |
|
34 var secondItem = document.getElementById("secondItem"); |
|
35 menulist.selectedItem = secondItem; |
|
36 |
|
37 ok(menulist.label == "bar", "second item was not selected"); |
|
38 secondItem.label = "new label"; |
|
39 ok(menulist.label == "new label", "menulist label was not updated to the label of its selected item"); |
|
40 ]]> |
|
41 </script> |
|
42 |
|
43 </window> |