4 https://bugzilla.mozilla.org/show_bug.cgi?id=583533
7 <title>Test for Bug
583514</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=583533">Mozilla Bug
583533</a>
15 <div id=
"e" accesskey=
"a">
19 <script type=
"application/javascript">
21 /** Test for Bug
583533 **/
23 var sbs = SpecialPowers.Cc['@mozilla.org/intl/stringbundle;
1'].
24 getService(SpecialPowers.Ci.nsIStringBundleService);
25 var bundle = sbs.createBundle(
"chrome://global-platform/locale/platformKeys.properties");
27 var shiftText = bundle.GetStringFromName(
"VK_SHIFT");
28 var altText = bundle.GetStringFromName(
"VK_ALT");
29 var controlText = bundle.GetStringFromName(
"VK_CONTROL");
30 var metaText = bundle.GetStringFromName(
"VK_COMMAND_OR_WIN");
31 var separatorText = bundle.GetStringFromName(
"MODIFIER_SEPARATOR");
33 var modifier = SpecialPowers.getIntPref(
"ui.key.contentAccess");
40 is(modifier <
16 && modifier
>=
0, true,
"Modifier in range");
42 // There are no consts for the mask of this prefs.
59 label += controlText + separatorText;
61 label += metaText + separatorText;
63 label += altText + separatorText;
65 label += shiftText + separatorText;
67 label += document.getElementById(
"e").accessKey;
69 is(label, document.getElementById(
"e").accessKeyLabel,
"JS and C++ agree on accessKeyLabel");
71 /** Test for Bug
808964 **/
73 var div = document.createElement(
"div");
74 document.body.appendChild(div);
76 is(div.accessKeyLabel,
"",
"accessKeyLabel should be empty string");