mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
Bug 1668663: Add support for navigation by blockquote r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D92145
This commit is contained in:
parent
a20d386028
commit
8ea7a5cbaf
@ -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;
|
||||
|
@ -36,3 +36,4 @@ skip-if = os == 'mac' && debug # Bug 1664577
|
||||
[browser_rotor.js]
|
||||
[browser_rootgroup.js]
|
||||
[browser_text_selection.js]
|
||||
[browser_navigate.js]
|
||||
|
66
accessible/tests/browser/mac/browser_navigate.js
Normal file
66
accessible/tests/browser/mac/browser_navigate.js
Normal file
@ -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(
|
||||
`
|
||||
<blockquote id="first">hello I am a blockquote</blockquote>
|
||||
<blockquote id="second">
|
||||
I am also a blockquote of the same level
|
||||
<br>
|
||||
<blockquote id="third">but I have a different level</blockquote>
|
||||
</blockquote>
|
||||
`,
|
||||
(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"
|
||||
);
|
||||
}
|
||||
);
|
Loading…
Reference in New Issue
Block a user