Bug 1569868 - ensure that accessibility properties list is focused when using browser or inspector context menus to inspect accessibility properties. r=mtigley
authorYura Zenevich <yura.zenevich@gmail.com>
Tue, 10 Dec 2019 22:28:52 +0000
changeset 506363 5fd7ad835de62e94f7c6a011671a1eda92ba4ca7
parent 506362 aeceec922866a913085fea03ff0d4c1ba6af60ae
child 506364 89f58295fb2b6c0198df8730f615510da87571d7
push id102834
push useryura.zenevich@gmail.com
push dateWed, 11 Dec 2019 00:34:45 +0000
treeherderautoland@5fd7ad835de6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtigley
bugs1569868
milestone73.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 1569868 - ensure that accessibility properties list is focused when using browser or inspector context menus to inspect accessibility properties. r=mtigley Differential Revision: https://phabricator.services.mozilla.com/D56574
devtools/client/accessibility/accessibility-view.js
devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js
devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js
--- a/devtools/client/accessibility/accessibility-view.js
+++ b/devtools/client/accessibility/accessibility-view.js
@@ -122,17 +122,17 @@ AccessibilityView.prototype = {
           if (accessible.indexInParent >= 0) {
             break;
           }
         }
       }
     }
 
     await this.store.dispatch(select(walker, accessible));
-    window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_HIGHLIGHTED);
+    window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED);
   },
 
   /**
    * Process message from accessibility panel.
    *
    * @param {Object} event  message type and data.
    */
   onMessage(event) {
--- a/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js
@@ -79,10 +79,14 @@ addA11YPanelTask(
       expectedSelectedNode
     );
     is(
       toolbox.getCurrentPanel(),
       panel,
       "Accessibility panel is currently selected"
     );
     is(selected, expectedSelected, "Accessible front selected correctly");
+
+    const doc = panel.panelWin.document;
+    const propertiesTree = doc.querySelector(".tree");
+    is(doc.activeElement, propertiesTree, "Properties list must be focused.");
   }
 );
--- a/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js
+++ b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js
@@ -62,16 +62,20 @@ async function checkAccessibleObjectSele
   await panelSelected;
   const selected = await objectSelected;
 
   const expectedNode = isText
     ? inspector.selection.nodeFront.inlineTextChild
     : inspector.selection.nodeFront;
   const expectedSelected = await panel.walker.getAccessibleFor(expectedNode);
   is(selected, expectedSelected, "Accessible front selected correctly");
+
+  const doc = panel.panelWin.document;
+  const propertiesTree = doc.querySelector(".tree");
+  is(doc.activeElement, propertiesTree, "Properties list must be focused.");
 }
 
 addA11YPanelTask(
   "Test show accessibility properties context menu.",
   TEST_URI,
   async function testShowAccessibilityPropertiesContextMenu(env) {
     let allMenuItems = await openContextMenuForNode(env);
     let showA11YPropertiesNode = checkShowA11YPropertiesNode(