|
1 <?xml version="1.0"?> |
|
2 |
|
3 <!-- This Source Code Form is subject to the terms of the Mozilla Public |
|
4 - License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> |
|
6 |
|
7 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
8 <?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?> |
|
9 |
|
10 <window id="366992 test" |
|
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
12 onload="onLoad();" |
|
13 width="600" |
|
14 height="600" |
|
15 title="366992 test"> |
|
16 |
|
17 <commandset id="editMenuCommands"/> |
|
18 |
|
19 <script type="application/javascript" |
|
20 src="chrome://global/content/globalOverlay.js"/> |
|
21 <script type="application/javascript"><![CDATA[ |
|
22 // Without the fix for bug 366992, the copy command would be enabled |
|
23 // for the textbox even though the textbox's controller for this command |
|
24 // disables it. |
|
25 var gShouldNotBeReachedController = { |
|
26 supportsCommand: function(aCommand) { |
|
27 return aCommand == "cmd_copy"; |
|
28 }, |
|
29 isCommandEnabled: function(aCommand) { |
|
30 return aCommand == "cmd_copy"; |
|
31 }, |
|
32 doCommand: function(aCommand) { } |
|
33 } |
|
34 |
|
35 function ok(condition, message) { |
|
36 window.opener.wrappedJSObject.SimpleTest.ok(condition, message); |
|
37 } |
|
38 function finish() { |
|
39 window.controllers.removeController(gShouldNotBeReachedController); |
|
40 window.close(); |
|
41 window.opener.wrappedJSObject.SimpleTest.finish(); |
|
42 } |
|
43 |
|
44 function onLoad() { |
|
45 document.getElementById("textbox").focus(); |
|
46 var copyDisabled = document.getElementById("cmd_copy") |
|
47 .getAttribute("disabled") == "true"; |
|
48 ok(copyDisabled, |
|
49 "cmd_copy should be disabled when the empty textbox is focused"); |
|
50 finish(); |
|
51 } |
|
52 |
|
53 window.controllers.appendController(gShouldNotBeReachedController); |
|
54 ]]></script> |
|
55 |
|
56 <textbox id="textbox"/> |
|
57 </window> |