diff --git a/accessible/mac/MOXSearchInfo.mm b/accessible/mac/MOXSearchInfo.mm index 18eaa99e724a..0d3210301400 100644 --- a/accessible/mac/MOXSearchInfo.mm +++ b/accessible/mac/MOXSearchInfo.mm @@ -242,10 +242,9 @@ using namespace mozilla::a11y; } if ([key isEqualToString:@"AXCheckboxSearchKey"]) { - RotorRoleRule rule = - mImmediateDescendantsOnly - ? RotorRoleRule(roles::CHECKBUTTON, geckoRootAcc) - : RotorRoleRule(roles::CHECKBUTTON); + RotorRoleRule rule = mImmediateDescendantsOnly + ? RotorRoleRule(roles::CHECKBUTTON, geckoRootAcc) + : RotorRoleRule(roles::CHECKBUTTON); [matches addObjectsFromArray:[self getMatchesForRule:rule]]; } @@ -255,6 +254,13 @@ using namespace mozilla::a11y; : RotorStaticTextRule(); [matches addObjectsFromArray:[self getMatchesForRule:rule]]; } + + if ([key isEqualToString:@"AXBlockquoteSearchKey"]) { + RotorRoleRule rule = mImmediateDescendantsOnly + ? RotorRoleRule(roles::BLOCKQUOTE, geckoRootAcc) + : RotorRoleRule(roles::BLOCKQUOTE); + [matches addObjectsFromArray:[self getMatchesForRule:rule]]; + } } return matches; diff --git a/accessible/tests/browser/mac/browser.ini b/accessible/tests/browser/mac/browser.ini index d09b6b6ab796..aba890f49867 100644 --- a/accessible/tests/browser/mac/browser.ini +++ b/accessible/tests/browser/mac/browser.ini @@ -36,3 +36,4 @@ skip-if = os == 'mac' && debug # Bug 1664577 [browser_rotor.js] [browser_rootgroup.js] [browser_text_selection.js] +[browser_navigate.js] diff --git a/accessible/tests/browser/mac/browser_navigate.js b/accessible/tests/browser/mac/browser_navigate.js new file mode 100644 index 000000000000..c64a1987a49a --- /dev/null +++ b/accessible/tests/browser/mac/browser_navigate.js @@ -0,0 +1,66 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/* + * Test rotor with blockquotes + */ +addAccessibleTask( + ` +
hello I am a blockquote+
+ I am also a blockquote of the same level ++ `, + (browser, accDoc) => { + let searchPred = { + AXSearchKey: "AXBlockquoteSearchKey", + AXImmediateDescendantsOnly: 0, + AXResultsLimit: -1, + AXDirection: "AXDirectionNext", + }; + + const webArea = accDoc.nativeInterface.QueryInterface( + Ci.nsIAccessibleMacInterface + ); + is( + webArea.getAttributeValue("AXRole"), + "AXWebArea", + "Got web area accessible" + ); + + let bquotes = webArea.getParameterizedAttributeValue( + "AXUIElementsForSearchPredicate", + NSDictionary(searchPred) + ); + + is(bquotes.length, 3, "Found three blockquotes"); + + const first = getNativeInterface(accDoc, "first"); + const second = getNativeInterface(accDoc, "second"); + const third = getNativeInterface(accDoc, "third"); + console.log("values :"); + console.log(first.getAttributeValue("AXValue")); + is( + first.getAttributeValue("AXValue"), + bquotes[0].getAttributeValue("AXValue"), + "Found correct first blockquote" + ); + + is( + second.getAttributeValue("AXValue"), + bquotes[1].getAttributeValue("AXValue"), + "Found correct second blockquote" + ); + + is( + third.getAttributeValue("AXValue"), + bquotes[2].getAttributeValue("AXValue"), + "Found correct third blockquote" + ); + } +);
+but I have a different level+