Bug 1640778 - remove auto-init experiment code. r=mtigley,devtools-backward-compat-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D77057
This commit is contained in:
Yura Zenevich
2020-06-30 14:53:07 +00:00
parent 49db804dee
commit da6e50b60d
18 changed files with 74 additions and 448 deletions

View File

@@ -375,37 +375,6 @@ class MarkupContextMenu {
this.inspector.emit("console-var-ready");
}
_buildA11YMenuItem(menu) {
if (
!(this.selection.isElementNode() || this.selection.isTextNode()) ||
!Services.prefs.getBoolPref("devtools.accessibility.enabled")
) {
return;
}
const a11yAutoInitEnabled = Services.prefs.getBoolPref(
"devtools.accessibility.auto-init.enabled",
false
);
const showA11YPropsItem = new MenuItem({
id: "node-menu-showaccessibilityproperties",
label: INSPECTOR_L10N.getStr(
"inspectorShowAccessibilityProperties.label"
),
click: () => this._showAccessibilityProperties(),
disabled: !a11yAutoInitEnabled,
});
// Only attempt to determine if a11y props menu item needs to be enabled if
// AccessibilityFront is enabled and accessibility panel auto init feature
// is disabled.
if (!a11yAutoInitEnabled && this.inspector.accessibilityFront.enabled) {
this._updateA11YMenuItem(showA11YPropsItem);
}
menu.append(showA11YPropsItem);
}
_getAttributesSubmenu(isEditableElement) {
const attributesSubmenu = new Menu();
const nodeInfo = this.nodeMenuTriggerInfo;
@@ -845,7 +814,17 @@ class MarkupContextMenu {
})
);
this._buildA11YMenuItem(menu);
if (this.selection.isElementNode() || this.selection.isTextNode()) {
menu.append(
new MenuItem({
id: "node-menu-showaccessibilityproperties",
label: INSPECTOR_L10N.getStr(
"inspectorShowAccessibilityProperties.label"
),
click: () => this._showAccessibilityProperties(),
})
);
}
if (this.selection.nodeFront.customElementLocation) {
menu.append(
@@ -955,19 +934,6 @@ class MarkupContextMenu {
menu.popup(screenX, screenY, this.toolbox.doc);
return menu;
}
async _updateA11YMenuItem(menuItem) {
const hasA11YProps = await this.walker.hasAccessibilityProperties(
this.selection.nodeFront
);
if (hasA11YProps) {
const menuItemEl = Menu.getMenuElementById(menuItem.id, this.toolbox.doc);
menuItemEl.disabled = menuItem.disabled = false;
}
this.inspector.emit("node-menu-updated");
}
}
module.exports = MarkupContextMenu;