Bug 1602075 - display Inspect Accessibility Properties menu item if devtools.accessibility.auto-init.enabled pref is set to true. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D71586
This commit is contained in:
Yura Zenevich
2020-04-23 14:40:17 +00:00
parent 6663110920
commit ebf3d66b18
2 changed files with 16 additions and 4 deletions

View File

@@ -503,8 +503,13 @@ class nsContextMenu {
var showInspectA11Y =
showInspect &&
// Only when accessibility service started.
Services.appinfo.accessibilityEnabled &&
// Only when accessibility service started or the panel can be
// auto-enabled.
(Services.appinfo.accessibilityEnabled ||
Services.prefs.getBoolPref(
"devtools.accessibility.auto-init.enabled",
false
)) &&
this.inTabBrowser &&
Services.prefs.getBoolPref("devtools.enabled", true) &&
Services.prefs.getBoolPref("devtools.accessibility.enabled", true) &&

View File

@@ -87,7 +87,10 @@ function getVisibleMenuItems(aMenu, aData) {
item.id != "fill-login-no-logins" &&
// XXX Screenshots doesn't have an access key. This needs
// at least bug 1320462 fixing first.
item.id != "screenshots_mozilla_org-menuitem-_create-screenshot"
item.id != "screenshots_mozilla_org-menuitem-_create-screenshot" &&
// Inspect accessibility properties does not have an access key. See
// bug 1630717 for more details.
item.id != "context-inspect-a11y"
) {
if (item.id != FRAME_OS_PID) {
ok(key, "menuitem " + item.id + " has an access key");
@@ -432,7 +435,11 @@ async function test_contextmenu(selector, menuItems, options = {}) {
if (
Services.prefs.getBoolPref("devtools.accessibility.enabled", true) &&
Services.appinfo.accessibilityEnabled
(Services.appinfo.accessibilityEnabled ||
Services.prefs.getBoolPref(
"devtools.accessibility.auto-init.enabled",
false
))
) {
let inspectA11YItems = ["context-inspect-a11y", true];
menuItems = menuItems.concat(inspectA11YItems);