From 7bc169515a17970b53cdf6eec5bb125195bf2193 Mon Sep 17 00:00:00 2001 From: Morgan Reschenberg Date: Mon, 24 May 2021 17:02:46 +0000 Subject: [PATCH] Bug 1710748: Return button menus when form controls are queried from rotor r=eeejay Differential Revision: https://phabricator.services.mozilla.com/D115429 --- accessible/mac/RotorRules.mm | 1 + accessible/tests/browser/mac/browser_rotor.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/accessible/mac/RotorRules.mm b/accessible/mac/RotorRules.mm index ef8c47a6dfcf..5bb5127bcc46 100644 --- a/accessible/mac/RotorRules.mm +++ b/accessible/mac/RotorRules.mm @@ -126,6 +126,7 @@ uint16_t RotorControlRule::Match(const AccessibleOrProxy& aAccOrProxy) { case roles::ENTRY: case roles::OUTLINE: case roles::PASSWORD_TEXT: + case roles::BUTTONMENU: return result; case roles::DATE_EDITOR: diff --git a/accessible/tests/browser/mac/browser_rotor.js b/accessible/tests/browser/mac/browser_rotor.js index b8151d41cefc..a4879a34d0e0 100644 --- a/accessible/tests/browser/mac/browser_rotor.js +++ b/accessible/tests/browser/mac/browser_rotor.js @@ -825,6 +825,8 @@ addAccessibleTask(
  • item1
  • item1
  • + + Click Me `, async (browser, accDoc) => { const searchPred = { @@ -847,7 +849,7 @@ addAccessibleTask( "AXUIElementCountForSearchPredicate", NSDictionary(searchPred) ); - is(3, controlsCount, "Found 3 controls"); + is(4, controlsCount, "Found 4 controls"); const controls = webArea.getParameterizedAttributeValue( "AXUIElementsForSearchPredicate", @@ -857,6 +859,7 @@ addAccessibleTask( const spin = getNativeInterface(accDoc, "spinbutton"); const details = getNativeInterface(accDoc, "details"); const tree = getNativeInterface(accDoc, "tree"); + const buttonMenu = getNativeInterface(accDoc, "buttonMenu"); is( spin.getAttributeValue("AXRole"), @@ -873,6 +876,11 @@ addAccessibleTask( controls[2].getAttributeValue("AXRole"), "Found correct tree" ); + is( + buttonMenu.getAttributeValue("AXRole"), + controls[3].getAttributeValue("AXRole"), + "Found correct button menu" + ); } );