Backed out 3 changesets (bug 1665962, bug 1666357, bug 1667174) for OS X bustages on MOXSearchInfo.mm and conflicts on browser_rotor.js. CLOSED TREE

Backed out changeset 495a69dcd720 (bug 1665962)
Backed out changeset 9cdbf4e04e19 (bug 1666357)
Backed out changeset 0d9d32b08317 (bug 1667174)
This commit is contained in:
Cosmin Sabou 2020-09-28 22:18:32 +03:00
parent 53d47afda5
commit 25fe081468
24 changed files with 276 additions and 349 deletions

View File

@ -1071,13 +1071,7 @@ enum Role {
*/
TIME_EDITOR = 183,
/**
* Represents the marker associated with a list item. In unordered lists,
* this is a bullet, while in ordered lists this is a number.
*/
LISTITEM_MARKER = 184,
LAST_ROLE = LISTITEM_MARKER
LAST_ROLE = TIME_EDITOR
};
} // namespace roles

View File

@ -1866,14 +1866,4 @@ ROLE(TIME_EDITOR,
ROLE_SYSTEM_GROUPING,
java::SessionAccessibility::CLASSNAME_VIEW,
eNameFromSubtreeIfReqRule)
ROLE(LISTITEM_MARKER,
"list item marker",
ATK_ROLE_UNKNOWN,
@"AXListMarker",
NSAccessibilityUnknownSubrole,
ROLE_SYSTEM_STATICTEXT,
ROLE_SYSTEM_STATICTEXT,
java::SessionAccessibility::CLASSNAME_VIEW,
eNoNameRule)
// clang-format on

View File

@ -578,8 +578,7 @@ TextAttrsMgr::AutoGeneratedTextAttr::AutoGeneratedTextAttr(
if (aAccessible)
mIsDefined = mNativeValue =
((aAccessible->NativeRole() == roles::STATICTEXT) ||
(aAccessible->NativeRole() == roles::LISTITEM_MARKER));
(aAccessible->NativeRole() == roles::STATICTEXT);
}
bool TextAttrsMgr::AutoGeneratedTextAttr::GetValueFor(Accessible* aAccessible,

View File

@ -154,9 +154,7 @@ ENameValueFlag HTMLListBulletAccessible::Name(nsString& aName) const {
return eNameOK;
}
role HTMLListBulletAccessible::NativeRole() const {
return roles::LISTITEM_MARKER;
}
role HTMLListBulletAccessible::NativeRole() const { return roles::STATICTEXT; }
uint64_t HTMLListBulletAccessible::NativeState() const {
return LeafAccessible::NativeState() | states::READONLY;

View File

@ -1065,10 +1065,4 @@ interface nsIAccessibleRole : nsISupports
*/
const unsigned long ROLE_TIME_EDITOR = 183;
/**
* Represents the marker associated with a list item. In unordered lists,
* this is a bullet, while in ordered lists this is a number.
*/
const unsigned long ROLE_LISTITEM_MARKER = 184;
};

View File

@ -90,8 +90,9 @@ using namespace mozilla::a11y;
NSMutableArray* matches = [[NSMutableArray alloc] init];
for (id key in mSearchKeys) {
if ([key isEqualToString:@"AXAnyTypeSearchKey"]) {
RotorRule rule =
mImmediateDescendantsOnly ? RotorRule(geckoStartAcc) : RotorRule();
RotorAllRule rule = mImmediateDescendantsOnly
? RotorAllRule(geckoStartAcc)
: RotorAllRule();
if (mSearchForward) {
if ([mStartElem isKindOfClass:[MOXWebAreaAccessible class]]) {
@ -123,30 +124,30 @@ using namespace mozilla::a11y;
}
if ([key isEqualToString:@"AXHeadingSearchKey"]) {
RotorRoleRule rule = mImmediateDescendantsOnly
? RotorRoleRule(roles::HEADING, geckoStartAcc)
: RotorRoleRule(roles::HEADING);
RotorHeadingRule rule = mImmediateDescendantsOnly
? RotorHeadingRule(geckoStartAcc)
: RotorHeadingRule();
[matches addObjectsFromArray:[self getMatchesForRule:rule]];
}
if ([key isEqualToString:@"AXArticleSearchKey"]) {
RotorRoleRule rule = mImmediateDescendantsOnly
? RotorRoleRule(roles::ARTICLE, geckoStartAcc)
: RotorRoleRule(roles::ARTICLE);
RotorArticleRule rule = mImmediateDescendantsOnly
? RotorArticleRule(geckoStartAcc)
: RotorArticleRule();
[matches addObjectsFromArray:[self getMatchesForRule:rule]];
}
if ([key isEqualToString:@"AXTableSearchKey"]) {
RotorRoleRule rule = mImmediateDescendantsOnly
? RotorRoleRule(roles::TABLE, geckoStartAcc)
: RotorRoleRule(roles::TABLE);
RotorTableRule rule = mImmediateDescendantsOnly
? RotorTableRule(geckoStartAcc)
: RotorTableRule();
[matches addObjectsFromArray:[self getMatchesForRule:rule]];
}
if ([key isEqualToString:@"AXLandmarkSearchKey"]) {
RotorRoleRule rule = mImmediateDescendantsOnly
? RotorRoleRule(roles::LANDMARK, geckoStartAcc)
: RotorRoleRule(roles::LANDMARK);
RotorLandmarkRule rule = mImmediateDescendantsOnly
? RotorLandmarkRule(geckoStartAcc)
: RotorLandmarkRule();
[matches addObjectsFromArray:[self getMatchesForRule:rule]];
}
@ -179,9 +180,9 @@ using namespace mozilla::a11y;
}
if ([key isEqualToString:@"AXButtonSearchKey"]) {
RotorRoleRule rule = mImmediateDescendantsOnly
? RotorRoleRule(roles::PUSHBUTTON, geckoStartAcc)
: RotorRoleRule(roles::PUSHBUTTON);
RotorButtonRule rule = mImmediateDescendantsOnly
? RotorButtonRule(geckoStartAcc)
: RotorButtonRule();
[matches addObjectsFromArray:[self getMatchesForRule:rule]];
}
@ -192,14 +193,6 @@ using namespace mozilla::a11y;
[matches addObjectsFromArray:[self getMatchesForRule:rule]];
}
if ([key isEqualToString:@"AXRadioGroupSearchKey"]) {
RotorRoleRule rule =
mImmediateDescendantsOnly
? RotorRoleRule(roles::RADIO_GROUP, geckoStartAcc)
: RotorRoleRule(roles::RADIO_GROUP);
[matches addObjectsFromArray:[self getMatchesForRule:rule]];
}
if ([key isEqualToString:@"AXFrameSearchKey"]) {
RotorFrameRule rule = mImmediateDescendantsOnly
? RotorFrameRule(geckoStartAcc)

View File

@ -11,46 +11,78 @@
using namespace mozilla::a11y;
/**
* This rule matches all accessibles that satisfy the "boilerplate"
* pivot conditions and have a corresponding native accessible.
* These rules match accessibles on a given role, filtering out non-direct
* descendants if necessary.
*/
class RotorRule : public PivotRule {
public:
explicit RotorRule(AccessibleOrProxy& aDirectDescendantsFrom);
explicit RotorRule();
uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
private:
AccessibleOrProxy mDirectDescendantsFrom;
class RotorHeadingRule final : public PivotRoleRule {
public:
explicit RotorHeadingRule();
explicit RotorHeadingRule(AccessibleOrProxy& aDirectDescendantsFrom);
};
/**
* This rule matches all accessibles of a given role.
*/
class RotorRoleRule final : public RotorRule {
class RotorArticleRule final : public PivotRoleRule {
public:
explicit RotorRoleRule(role aRole, AccessibleOrProxy& aDirectDescendantsFrom);
explicit RotorRoleRule(role aRole);
uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
private:
role mRole;
explicit RotorArticleRule();
explicit RotorArticleRule(AccessibleOrProxy& aDirectDescendantsFrom);
};
class RotorControlRule final : public RotorRule {
class RotorTableRule final : public PivotRoleRule {
public:
explicit RotorTableRule();
explicit RotorTableRule(AccessibleOrProxy& aDirectDescendantsFrom);
};
class RotorLandmarkRule final : public PivotRoleRule {
public:
explicit RotorLandmarkRule();
explicit RotorLandmarkRule(AccessibleOrProxy& aDirectDescendantsFrom);
};
class RotorListRule final : public PivotRoleRule {
public:
explicit RotorListRule();
explicit RotorListRule(AccessibleOrProxy& aDirectDescendantsFrom);
};
class RotorButtonRule final : public PivotRoleRule {
public:
explicit RotorButtonRule();
explicit RotorButtonRule(AccessibleOrProxy& aDirectDescendantsFrom);
};
class RotorFrameRule final : public PivotRoleRule {
public:
explicit RotorFrameRule();
explicit RotorFrameRule(AccessibleOrProxy& aDirectDescendantsFrom);
};
class RotorImageRule final : public PivotRoleRule {
public:
explicit RotorImageRule();
explicit RotorImageRule(AccessibleOrProxy& aDirectDescendantsFrom);
};
class RotorControlRule final : public PivotRule {
public:
explicit RotorControlRule(AccessibleOrProxy& aDirectDescendantsFrom);
explicit RotorControlRule();
virtual uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
private:
AccessibleOrProxy mDirectDescendantsFrom;
};
class RotorLinkRule : public RotorRule {
class RotorLinkRule : public PivotRule {
public:
explicit RotorLinkRule();
explicit RotorLinkRule(AccessibleOrProxy& aDirectDescendantsFrom);
virtual uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
protected:
AccessibleOrProxy mDirectDescendantsFrom;
};
class RotorVisitedLinkRule final : public RotorLinkRule {
@ -68,3 +100,18 @@ class RotorUnvisitedLinkRule final : public RotorLinkRule {
virtual uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
};
/**
* This rule matches all accessibles, filtering out non-direct
* descendants if necessary.
*/
class RotorAllRule final : public PivotRule {
public:
explicit RotorAllRule(AccessibleOrProxy& aDirectDescendantsFrom);
explicit RotorAllRule();
virtual uint16_t Match(const AccessibleOrProxy& aAccOrProxy) override;
private:
AccessibleOrProxy mDirectDescendantsFrom;
};

View File

@ -12,56 +12,37 @@
using namespace mozilla::a11y;
// Generic Rotor Rule
// Role Rules
RotorRule::RotorRule(AccessibleOrProxy& aDirectDescendantsFrom)
: mDirectDescendantsFrom(aDirectDescendantsFrom) {}
RotorHeadingRule::RotorHeadingRule() : PivotRoleRule(roles::HEADING) {}
RotorRule::RotorRule() : mDirectDescendantsFrom(nullptr) {}
RotorHeadingRule::RotorHeadingRule(AccessibleOrProxy& aDirectDescendantsFrom)
: PivotRoleRule(roles::HEADING, aDirectDescendantsFrom) {}
uint16_t RotorRule::Match(const AccessibleOrProxy& aAccOrProxy) {
uint16_t result = nsIAccessibleTraversalRule::FILTER_IGNORE;
RotorArticleRule::RotorArticleRule() : PivotRoleRule(roles::ARTICLE) {}
if (nsAccUtils::MustPrune(aAccOrProxy)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
RotorArticleRule::RotorArticleRule(AccessibleOrProxy& aDirectDescendantsFrom)
: PivotRoleRule(roles::ARTICLE, aDirectDescendantsFrom) {}
if (!mDirectDescendantsFrom.IsNull() &&
(aAccOrProxy != mDirectDescendantsFrom)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
RotorTableRule::RotorTableRule() : PivotRoleRule(roles::TABLE) {}
if ([GetNativeFromGeckoAccessible(aAccOrProxy) isAccessibilityElement]) {
result |= nsIAccessibleTraversalRule::FILTER_MATCH;
}
RotorTableRule::RotorTableRule(AccessibleOrProxy& aDirectDescendantsFrom)
: PivotRoleRule(roles::TABLE, aDirectDescendantsFrom) {}
return result;
}
RotorLandmarkRule::RotorLandmarkRule() : PivotRoleRule(roles::LANDMARK) {}
// Rotor Role Rule
RotorLandmarkRule::RotorLandmarkRule(AccessibleOrProxy& aDirectDescendantsFrom)
: PivotRoleRule(roles::LANDMARK, aDirectDescendantsFrom) {}
RotorRoleRule::RotorRoleRule(role aRole,
AccessibleOrProxy& aDirectDescendantsFrom)
: RotorRule(aDirectDescendantsFrom), mRole(aRole){};
RotorListRule::RotorListRule() : PivotRoleRule(roles::LIST) {}
RotorRoleRule::RotorRoleRule(role aRole) : RotorRule(), mRole(aRole){};
RotorListRule::RotorListRule(AccessibleOrProxy& aDirectDescendantsFrom)
: PivotRoleRule(roles::LIST, aDirectDescendantsFrom) {}
uint16_t RotorRoleRule::Match(const AccessibleOrProxy& aAccOrProxy) {
uint16_t result = RotorRule::Match(aAccOrProxy);
RotorButtonRule::RotorButtonRule() : PivotRoleRule(roles::PUSHBUTTON) {}
// if a match was found in the base-class's Match function,
// it is valid to consider that match again here. if it is
// not of the desired role, we flip the match bit to "unmatch"
// otherwise, the match persists.
if ((result & nsIAccessibleTraversalRule::FILTER_MATCH) &&
aAccOrProxy.Role() != mRole) {
result &= ~nsIAccessibleTraversalRule::FILTER_MATCH;
}
return result;
}
// Rotor Control Rule
RotorButtonRule::RotorButtonRule(AccessibleOrProxy& aDirectDescendantsFrom)
: PivotRoleRule(roles::PUSHBUTTON, aDirectDescendantsFrom) {}
RotorFrameRule::RotorFrameRule() : PivotRoleRule(roles::DOCUMENT) {}
@ -74,92 +55,100 @@ RotorImageRule::RotorImageRule(AccessibleOrProxy& aDirectDescendantsFrom)
: PivotRoleRule(roles::GRAPHIC, aDirectDescendantsFrom) {}
RotorControlRule::RotorControlRule(AccessibleOrProxy& aDirectDescendantsFrom)
: RotorRule(aDirectDescendantsFrom){};
: mDirectDescendantsFrom(aDirectDescendantsFrom) {}
RotorControlRule::RotorControlRule() : RotorRule(){};
RotorControlRule::RotorControlRule() : mDirectDescendantsFrom(nullptr) {}
uint16_t RotorControlRule::Match(const AccessibleOrProxy& aAccOrProxy) {
uint16_t result = RotorRule::Match(aAccOrProxy);
uint16_t result = nsIAccessibleTraversalRule::FILTER_IGNORE;
// if a match was found in the base-class's Match function,
// it is valid to consider that match again here. if it is
// not of the desired role, we flip the match bit to "unmatch"
// otherwise, the match persists.
if ((result & nsIAccessibleTraversalRule::FILTER_MATCH)) {
switch (aAccOrProxy.Role()) {
case roles::PUSHBUTTON:
case roles::SPINBUTTON:
case roles::DETAILS:
case roles::CHECKBUTTON:
case roles::COLOR_CHOOSER:
case roles::BUTTONDROPDOWNGRID: // xul colorpicker
case roles::LISTBOX:
case roles::COMBOBOX:
case roles::EDITCOMBOBOX:
case roles::RADIOBUTTON:
case roles::RADIO_GROUP:
case roles::PAGETAB:
case roles::SLIDER:
case roles::SWITCH:
case roles::ENTRY:
case roles::OUTLINE:
case roles::PASSWORD_TEXT:
return result;
if (nsAccUtils::MustPrune(aAccOrProxy)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
case roles::DATE_EDITOR:
case roles::TIME_EDITOR:
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
return result;
if (!mDirectDescendantsFrom.IsNull() &&
(aAccOrProxy != mDirectDescendantsFrom)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
case roles::GROUPING: {
// Groupings are sometimes used (like radio groups) to denote
// sets of controls. If that's the case, we want to surface
// them. We also want to surface grouped time and date controls.
for (unsigned int i = 0; i < aAccOrProxy.ChildCount(); i++) {
AccessibleOrProxy currChild = aAccOrProxy.ChildAt(i);
if (currChild.Role() == roles::CHECKBUTTON ||
currChild.Role() == roles::SWITCH ||
currChild.Role() == roles::SPINBUTTON ||
currChild.Role() == roles::RADIOBUTTON) {
return result;
}
switch (aAccOrProxy.Role()) {
case roles::PUSHBUTTON:
case roles::SPINBUTTON:
case roles::DETAILS:
case roles::CHECKBUTTON:
case roles::COLOR_CHOOSER:
case roles::BUTTONDROPDOWNGRID: // xul colorpicker
case roles::LISTBOX:
case roles::COMBOBOX:
case roles::EDITCOMBOBOX:
case roles::RADIOBUTTON:
case roles::RADIO_GROUP:
case roles::PAGETAB:
case roles::SLIDER:
case roles::SWITCH:
case roles::ENTRY:
case roles::OUTLINE:
case roles::PASSWORD_TEXT:
result |= nsIAccessibleTraversalRule::FILTER_MATCH;
break;
case roles::GROUPING: {
// Groupings are sometimes used (like radio groups) to denote
// sets of controls. If that's the case, we want to surface
// them. We also want to surface grouped time and date controls.
for (unsigned int i = 0; i < aAccOrProxy.ChildCount(); i++) {
AccessibleOrProxy currChild = aAccOrProxy.ChildAt(i);
if (currChild.Role() == roles::CHECKBUTTON ||
currChild.Role() == roles::SWITCH ||
currChild.Role() == roles::SPINBUTTON ||
currChild.Role() == roles::RADIOBUTTON) {
result |= nsIAccessibleTraversalRule::FILTER_MATCH;
break;
}
// if we iterated through the groups children and didn't
// find a control with one of the roles above, we should
// ignore this grouping
result &= ~nsIAccessibleTraversalRule::FILTER_MATCH;
return result;
}
default:
// if we did not match on any above role, we should
// ignore this accessible.
result &= ~nsIAccessibleTraversalRule::FILTER_MATCH;
break;
}
case roles::DATE_EDITOR:
case roles::TIME_EDITOR:
result |= nsIAccessibleTraversalRule::FILTER_MATCH;
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
break;
default:
break;
}
return result;
}
// Rotor Link Rule
RotorLinkRule::RotorLinkRule() : mDirectDescendantsFrom(nullptr) {}
RotorLinkRule::RotorLinkRule(AccessibleOrProxy& aDirectDescendantsFrom)
: RotorRule(aDirectDescendantsFrom){};
RotorLinkRule::RotorLinkRule() : RotorRule(){};
: mDirectDescendantsFrom(aDirectDescendantsFrom) {}
uint16_t RotorLinkRule::Match(const AccessibleOrProxy& aAccOrProxy) {
uint16_t result = RotorRule::Match(aAccOrProxy);
uint16_t result = nsIAccessibleTraversalRule::FILTER_IGNORE;
// if a match was found in the base-class's Match function,
// it is valid to consider that match again here. if it is
// not of the desired role, we flip the match bit to "unmatch"
// otherwise, the match persists.
if ((result & nsIAccessibleTraversalRule::FILTER_MATCH)) {
mozAccessible* nativeMatch = GetNativeFromGeckoAccessible(aAccOrProxy);
if (![[nativeMatch moxRole] isEqualToString:@"AXLink"]) {
result &= ~nsIAccessibleTraversalRule::FILTER_MATCH;
if (nsAccUtils::MustPrune(aAccOrProxy)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
if (!mDirectDescendantsFrom.IsNull() &&
(aAccOrProxy != mDirectDescendantsFrom)) {
// If we've specified mDirectDescendantsFrom, we should ignore
// non-direct descendants of from the specified AoP. Because
// pivot performs a preorder traversal, the first aAccOrProxy
// object(s) that don't equal mDirectDescendantsFrom will be
// mDirectDescendantsFrom's children. We'll process them, but ignore
// their subtrees thereby processing direct descendants of
// mDirectDescendantsFrom only.
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
if (mozAccessible* nativeMatch = GetNativeFromGeckoAccessible(aAccOrProxy)) {
if ([[nativeMatch moxRole] isEqualToString:@"AXLink"]) {
result |= nsIAccessibleTraversalRule::FILTER_MATCH;
}
}
@ -173,12 +162,28 @@ RotorVisitedLinkRule::RotorVisitedLinkRule(
: RotorLinkRule(aDirectDescendantsFrom) {}
uint16_t RotorVisitedLinkRule::Match(const AccessibleOrProxy& aAccOrProxy) {
uint16_t result = RotorLinkRule::Match(aAccOrProxy);
uint16_t result = nsIAccessibleTraversalRule::FILTER_IGNORE;
if (result & nsIAccessibleTraversalRule::FILTER_MATCH) {
mozAccessible* nativeMatch = GetNativeFromGeckoAccessible(aAccOrProxy);
if (![[nativeMatch moxVisited] boolValue]) {
result &= ~nsIAccessibleTraversalRule::FILTER_MATCH;
if (nsAccUtils::MustPrune(aAccOrProxy)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
if (!mDirectDescendantsFrom.IsNull() &&
(aAccOrProxy != mDirectDescendantsFrom)) {
// If we've specified mDirectDescendantsFrom, we should ignore
// non-direct descendants of from the specified AoP. Because
// pivot performs a preorder traversal, the first aAccOrProxy
// object(s) that don't equal mDirectDescendantsFrom will be
// mDirectDescendantsFrom's children. We'll process them, but ignore
// their subtrees thereby processing direct descendants of
// mDirectDescendantsFrom only.
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
if (mozAccessible* nativeMatch = GetNativeFromGeckoAccessible(aAccOrProxy)) {
if ([[nativeMatch moxRole] isEqualToString:@"AXLink"] &&
[[nativeMatch moxVisited] boolValue] == YES) {
result |= nsIAccessibleTraversalRule::FILTER_MATCH;
}
}
@ -192,14 +197,54 @@ RotorUnvisitedLinkRule::RotorUnvisitedLinkRule(
: RotorLinkRule(aDirectDescendantsFrom) {}
uint16_t RotorUnvisitedLinkRule::Match(const AccessibleOrProxy& aAccOrProxy) {
uint16_t result = RotorLinkRule::Match(aAccOrProxy);
uint16_t result = nsIAccessibleTraversalRule::FILTER_IGNORE;
if (result & nsIAccessibleTraversalRule::FILTER_MATCH) {
mozAccessible* nativeMatch = GetNativeFromGeckoAccessible(aAccOrProxy);
if ([[nativeMatch moxVisited] boolValue]) {
result &= ~nsIAccessibleTraversalRule::FILTER_MATCH;
if (nsAccUtils::MustPrune(aAccOrProxy)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
if (!mDirectDescendantsFrom.IsNull() &&
(aAccOrProxy != mDirectDescendantsFrom)) {
// If we've specified mDirectDescendantsFrom, we should ignore
// non-direct descendants of from the specified AoP. Because
// pivot performs a preorder traversal, the first aAccOrProxy
// object(s) that don't equal mDirectDescendantsFrom will be
// mDirectDescendantsFrom's children. We'll process them, but ignore
// their subtrees thereby processing direct descendants of
// mDirectDescendantsFrom only.
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
if (mozAccessible* nativeMatch = GetNativeFromGeckoAccessible(aAccOrProxy)) {
if ([[nativeMatch moxRole] isEqualToString:@"AXLink"] &&
[[nativeMatch moxVisited] boolValue] == NO) {
result |= nsIAccessibleTraversalRule::FILTER_MATCH;
}
}
return result;
}
// Match All Rule
RotorAllRule::RotorAllRule(AccessibleOrProxy& aDirectDescendantsFrom)
: mDirectDescendantsFrom(aDirectDescendantsFrom) {}
RotorAllRule::RotorAllRule() : mDirectDescendantsFrom(nullptr) {}
uint16_t RotorAllRule::Match(const AccessibleOrProxy& aAccOrProxy) {
uint16_t result = nsIAccessibleTraversalRule::FILTER_IGNORE;
if (nsAccUtils::MustPrune(aAccOrProxy)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
if (!mDirectDescendantsFrom.IsNull() &&
(aAccOrProxy != mDirectDescendantsFrom)) {
result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
}
result |= nsIAccessibleTraversalRule::FILTER_MATCH;
return result;
}

View File

@ -25,7 +25,7 @@ addAccessibleTask(
role: ROLE_LISTITEM,
children: [
{
role: ROLE_LISTITEM_MARKER,
role: ROLE_STATICTEXT,
children: [],
},
{

View File

@ -37,7 +37,7 @@ addAccessibleTask(
{
role: ROLE_LISTITEM,
children: [
{ role: ROLE_LISTITEM_MARKER, name: "1. ", children: [] },
{ role: ROLE_STATICTEXT, name: "1. ", children: [] },
{ role: ROLE_TEXT_LEAF, children: [] },
],
},

View File

@ -46,7 +46,7 @@ addAccessibleTask(
{
LIST: [
{
LISTITEM: [{ LISTITEM_MARKER: [] }, { TEXT_LEAF: [] }],
LISTITEM: [{ STATICTEXT: [] }, { TEXT_LEAF: [] }],
},
],
},

View File

@ -117,10 +117,7 @@ addAccessibleTask(
{
LIST: [
{
LISTITEM: [
{ LISTITEM_MARKER: [] },
{ TEXT_LEAF: [] },
],
LISTITEM: [{ STATICTEXT: [] }, { TEXT_LEAF: [] }],
},
],
},

View File

@ -669,7 +669,7 @@ addAccessibleTask(
range,
];
for (let i = 0; i < toCheck.length; i) {
for (let i = 0; i < toCheck.length; i++) {
is(
toCheck[i].getAttributeValue("AXValue"),
controls[i].getAttributeValue("AXValue"),
@ -1049,135 +1049,6 @@ addAccessibleTask(
}
);
/**
* Test rotor with radiogroups
*/
addAccessibleTask(
`
<div role="radiogroup" id="radios" aria-labelledby="desc">
<h1 id="desc">some radio buttons</h1>
<div id="radio1" role="radio"> Radio 1</div>
<div id="radio2" role="radio"> Radio 2</div>
</div>
`,
async (browser, accDoc) => {
const searchPred = {
AXSearchKey: "AXRadioGroupSearchKey",
AXImmediateDescendants: 1,
AXResultsLimit: -1,
AXDirection: "AXDirectionNext",
};
const webArea = accDoc.nativeInterface.QueryInterface(
Ci.nsIAccessibleMacInterface
);
is(
webArea.getAttributeValue("AXRole"),
"AXWebArea",
"Got web area accessible"
);
const radiogroupCount = webArea.getParameterizedAttributeValue(
"AXUIElementCountForSearchPredicate",
NSDictionary(searchPred)
);
is(1, radiogroupCount, "Found 1 radio group");
const controls = webArea.getParameterizedAttributeValue(
"AXUIElementsForSearchPredicate",
NSDictionary(searchPred)
);
const radios = getNativeInterface(accDoc, "radios");
is(
radios.getAttributeValue("AXDescription"),
controls[0].getAttributeValue("AXDescription"),
"Found correct group of radios"
);
}
);
/**
* Test rotor with static text
*/
addAccessibleTask(
`
<h1>Hello I am a heading</h1>
This is some regular text.<p>this is some paragraph text</p><br>
This is a list:<ul>
<li>List item one</li>
<li>List item two</li>
</ul>
<a href="http://example.com">This is a link</a>
`,
async (browser, accDoc) => {
const searchPred = {
AXSearchKey: "AXStaticTextSearchKey",
AXImmediateDescendants: 0,
AXResultsLimit: -1,
AXDirection: "AXDirectionNext",
};
const webArea = accDoc.nativeInterface.QueryInterface(
Ci.nsIAccessibleMacInterface
);
is(
webArea.getAttributeValue("AXRole"),
"AXWebArea",
"Got web area accessible"
);
const textCount = webArea.getParameterizedAttributeValue(
"AXUIElementCountForSearchPredicate",
NSDictionary(searchPred)
);
is(7, textCount, "Found 7 pieces of text");
const text = webArea.getParameterizedAttributeValue(
"AXUIElementsForSearchPredicate",
NSDictionary(searchPred)
);
is(
"Hello I am a heading",
text[0].getAttributeValue("AXValue"),
"Found correct text node for heading"
);
is(
"This is some regular text.",
text[1].getAttributeValue("AXValue"),
"Found correct text node"
);
is(
"this is some paragraph text",
text[2].getAttributeValue("AXValue"),
"Found correct text node for paragraph"
);
is(
"This is a list:",
text[3].getAttributeValue("AXValue"),
"Found correct text node for pre-list text node"
);
is(
"List item one",
text[4].getAttributeValue("AXValue"),
"Found correct text node for list item one"
);
is(
"List item two",
text[5].getAttributeValue("AXValue"),
"Found correct text node for list item two"
);
is(
"This is a link",
text[6].getAttributeValue("AXValue"),
"Found correct text node for link"
);
}
);
/**
* Test rotor with lists
*/

View File

@ -1030,21 +1030,21 @@
children: [
{ role: ROLE_LISTITEM,
children: [ // home
{ role: ROLE_LISTITEM_MARKER },
{ role: ROLE_STATICTEXT },
{ role: ROLE_TEXT_LEAF }
]
},
{
role: ROLE_LISTITEM,
children: [
{ role: ROLE_LISTITEM_MARKER },
{ role: ROLE_STATICTEXT },
{ role: ROLE_TEXT_LEAF }, // about
{
role: ROLE_LIST, // menu
children: [
{ role: ROLE_LISTITEM,
children: [
{ role: ROLE_LISTITEM_MARKER },
{ role: ROLE_STATICTEXT },
{ role: ROLE_TEXT_LEAF } // our story
]
},
@ -1062,7 +1062,7 @@
{
role: ROLE_LISTITEM,
children: [
{ role: ROLE_LISTITEM_MARKER },
{ role: ROLE_STATICTEXT },
{
role: ROLE_PUSHBUTTON,
children: [
@ -1075,7 +1075,7 @@
{
role: ROLE_LISTITEM,
children: [
{ role: ROLE_LISTITEM_MARKER },
{ role: ROLE_STATICTEXT },
{
role: ROLE_PUSHBUTTON,
children: [

View File

@ -62,7 +62,7 @@ var ObjectTraversalRule = {
rv = FILTER_IGNORE_SUBTREE | FILTER_MATCH;
} else if (
aAccessible.childCount == 0 &&
role != ROLE_LISTITEM_MARKER &&
role != ROLE_STATICTEXT &&
aAccessible.name.trim()
) {
rv = FILTER_MATCH;

View File

@ -55,7 +55,6 @@ const ROLE_LINK = nsIAccessibleRole.ROLE_LINK;
const ROLE_LIST = nsIAccessibleRole.ROLE_LIST;
const ROLE_LISTBOX = nsIAccessibleRole.ROLE_LISTBOX;
const ROLE_LISTITEM = nsIAccessibleRole.ROLE_LISTITEM;
const ROLE_LISTITEM_MARKER = nsIAccessibleRole.ROLE_LISTITEM_MARKER;
const ROLE_MARK = nsIAccessibleRole.ROLE_MARK;
const ROLE_MATHML_MATH = nsIAccessibleRole.ROLE_MATHML_MATH;
const ROLE_MATHML_IDENTIFIER = nsIAccessibleRole.ROLE_MATHML_IDENTIFIER;

View File

@ -19,7 +19,7 @@
{ SECTION: [ // container
{ MENUPOPUP: [ // menu
{ MENUITEM: [
{ LISTITEM_MARKER: [] }, // bullet
{ STATICTEXT: [] }, // bullet
{ TEXT_LEAF: [] },
] },
] },
@ -31,7 +31,7 @@
{ SECTION: [ // container
{ MENUPOPUP: [ // menu
{ MENUITEM: [
{ LISTITEM_MARKER: [] }, // bullet
{ STATICTEXT: [] }, // bullet
{ TEXT_LEAF: [] },
] },
] },
@ -43,7 +43,7 @@
{ SECTION: [ // container
{ MENUPOPUP: [ // menu
{ PARENT_MENUITEM: [ // menuitem with aria-haspopup="true"
{ LISTITEM_MARKER: [] }, // bullet
{ STATICTEXT: [] }, // bullet
{ TEXT_LEAF: [] },
] },
] },

View File

@ -77,11 +77,11 @@
tree =
{ PUSHBUTTON: [ // ul
{ TEXT_CONTAINER: [ // li
{ LISTITEM_MARKER: [ ] },
{ STATICTEXT: [ ] },
{ TEXT_LEAF: [ ] },
] },
{ TEXT_CONTAINER: [ // span styled as a list
{ LISTITEM_MARKER: [ ] },
{ STATICTEXT: [ ] },
{ TEXT_LEAF: [ ] },
] },
] };
@ -90,7 +90,7 @@
tree =
{ PUSHBUTTON: [ // ol
{ TEXT_CONTAINER: [ // li
{ LISTITEM_MARKER: [ ] },
{ STATICTEXT: [ ] },
{ TEXT_LEAF: [ ] },
] },
] };

View File

@ -18,11 +18,11 @@ function doTest() {
let tree =
{ LIST: [
{ LISTITEM: [
{ LISTITEM_MARKER: [] },
{ STATICTEXT: [] },
{ TEXT_LEAF: [] },
]},
{ LISTITEM: [
{ LISTITEM_MARKER: [] },
{ STATICTEXT: [] },
{ TEXT_LEAF: [] },
]},
] };

View File

@ -18,7 +18,7 @@
role: ROLE_LISTITEM,
children: [
{
role: ROLE_LISTITEM_MARKER,
role: ROLE_STATICTEXT,
name: aBulletText,
},
{
@ -106,7 +106,7 @@
tree =
{ LIST: [ // ol
{ LISTITEM: [ // li
{ LISTITEM_MARKER: [ ] },
{ STATICTEXT: [ ] },
{ DEFINITION_LIST: [ // dl
{ TERM: [ // dt
{ TEXT_LEAF: [] },

View File

@ -197,7 +197,7 @@
function listItemReframe() {
testAccessibleTree("li",{ LISTITEM: [
{ LISTITEM_MARKER: [] },
{ STATICTEXT: [] },
{ TEXT_LEAF: [] },
] });
@ -206,7 +206,7 @@
window.windowUtils.advanceTimeAndRefresh(100);
testAccessibleTree("li",{ LISTITEM: [
{ LISTITEM_MARKER: [] },
{ STATICTEXT: [] },
{ TEXT_LEAF: [] },
] });

View File

@ -120,7 +120,7 @@
{ SECTION: [ // container
{ LIST: [
{ LISTITEM: [
{ LISTITEM_MARKER: [] },
{ STATICTEXT: [] },
{ TEXT_LEAF: [] },
] },
] },

View File

@ -26,7 +26,7 @@
role: ROLE_LISTITEM,
children: [
{
role: ROLE_LISTITEM_MARKER,
role: ROLE_STATICTEXT,
children: [],
},
{
@ -87,7 +87,7 @@
this.onProcessed = function textReplaceProcessor_onProcessed() {
var tree = {
LISTITEM: [
{ LISTITEM_MARKER: [] },
{ STATICTEXT: [] },
{ TEXT_LEAF: [] },
],
};

View File

@ -42,7 +42,7 @@
role: ROLE_LISTITEM,
children: [
{
role: ROLE_LISTITEM_MARKER,
role: ROLE_STATICTEXT,
name: "1. ",
children: [],
},