Bug 1636831 - change the order of inspect element and inspect accessibility properties context menu items to preserve the former as the last item in the menu. r=nchevobbe
authorYura Zenevich <yura.zenevich@gmail.com>
Wed, 20 May 2020 15:26:22 +0000
changeset 531259 96fdfd1887ce56a148cffceebf5f3dc0cc446b31
parent 531258 0143fd91ba203aab4103c98f09d0dc2bf7b21e30
child 531260 76aead72792b86ae34dc912e668cc9d00be34b30
push id37436
push userncsoregi@mozilla.com
push dateWed, 20 May 2020 21:30:50 +0000
treeherdermozilla-central@6c10970490f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1636831
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1636831 - change the order of inspect element and inspect accessibility properties context menu items to preserve the former as the last item in the menu. r=nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D76005
browser/base/content/browser-context.inc
browser/base/content/test/contextMenu/contextmenu_common.js
--- a/browser/base/content/browser-context.inc
+++ b/browser/base/content/browser-context.inc
@@ -371,23 +371,23 @@
       <menuseparator hidden="true" id="context-sep-bidi"/>
       <menuitem hidden="true" id="context-bidi-text-direction-toggle"
                 data-l10n-id="main-context-menu-bidi-switch-text"
                 command="cmd_switchTextDirection"/>
       <menuitem hidden="true" id="context-bidi-page-direction-toggle"
                 data-l10n-id="main-context-menu-bidi-switch-page"
                 oncommand="gContextMenu.switchPageDirection();"/>
       <menuseparator id="inspect-separator" hidden="true"/>
+      <menuitem id="context-inspect-a11y"
+                hidden="true"
+                data-l10n-id="main-context-menu-inspect-a11y-properties"
+                oncommand="gContextMenu.inspectA11Y();"/>
       <menuitem id="context-inspect"
                 hidden="true"
                 data-l10n-id="main-context-menu-inspect-element"
                 oncommand="gContextMenu.inspectNode();"/>
-      <menuitem id="context-inspect-a11y"
-                hidden="true"
-                data-l10n-id="main-context-menu-inspect-a11y-properties"
-                oncommand="gContextMenu.inspectA11Y();"/>
       <menuseparator id="context-media-eme-separator" hidden="true"/>
       <menuitem id="context-media-eme-learnmore"
                 class="menuitem-iconic"
                 hidden="true"
                 data-l10n-id="main-context-menu-eme-learn-more"
                 oncommand="gContextMenu.drmLearnMore(event);"
                 onclick="checkForMiddleClick(this, event);"/>
--- a/browser/base/content/test/contextMenu/contextmenu_common.js
+++ b/browser/base/content/test/contextMenu/contextmenu_common.js
@@ -424,30 +424,30 @@ async function test_contextmenu(selector
 
   if (options.onContextMenuShown) {
     await options.onContextMenuShown();
     info("Completed onContextMenuShown");
   }
 
   if (menuItems) {
     if (Services.prefs.getBoolPref("devtools.inspector.enabled", true)) {
-      let inspectItems = ["---", null, "context-inspect", true];
-      menuItems = menuItems.concat(inspectItems);
-    }
+      const inspectItems = ["---", null];
+      if (
+        Services.prefs.getBoolPref("devtools.accessibility.enabled", true) &&
+        (Services.appinfo.accessibilityEnabled ||
+          Services.prefs.getBoolPref(
+            "devtools.accessibility.auto-init.enabled",
+            false
+          ))
+      ) {
+        inspectItems.push("context-inspect-a11y", true);
+      }
 
-    if (
-      Services.prefs.getBoolPref("devtools.accessibility.enabled", true) &&
-      (Services.appinfo.accessibilityEnabled ||
-        Services.prefs.getBoolPref(
-          "devtools.accessibility.auto-init.enabled",
-          false
-        ))
-    ) {
-      let inspectA11YItems = ["context-inspect-a11y", true];
-      menuItems = menuItems.concat(inspectA11YItems);
+      inspectItems.push("context-inspect", true);
+      menuItems = menuItems.concat(inspectItems);
     }
 
     if (
       options.maybeScreenshotsPresent &&
       !Services.prefs.getBoolPref("extensions.screenshots.disabled", false)
     ) {
       let screenshotItems = [
         "---",